Fix some ugly shit

This commit is contained in:
JeremyStar™ 2024-07-08 14:25:42 +02:00
parent 2230c4018a
commit 8d9e1db8f2
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
27 changed files with 98 additions and 49 deletions

View file

@ -88,8 +88,9 @@ public final class FourNumberVersioningSystem implements VersioningSystem {
private final int number4;
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "n4";
}

View file

@ -107,8 +107,9 @@ public final class SemanticVersioningSystem implements VersioningSystem {
private final int build;
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "Semantic";
}

View file

@ -107,8 +107,9 @@ public final class StarOpenSourceVersioningSystem implements VersioningSystem {
private final String fork;
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "StarOpenSource";
}

View file

@ -75,8 +75,9 @@ public final class ThreeNumberVersioningSystem implements VersioningSystem {
private final int number3;
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "n3";
}

View file

@ -62,8 +62,9 @@ public final class TwoNumberVersioningSystem implements VersioningSystem {
private final int number2;
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "n2";
}

View file

@ -39,14 +39,16 @@ public final class JvmArguments implements Placeholder {
public JvmArguments() {}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "jvm_arguments";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
StringBuilder arguments = new StringBuilder();
for (String argument : JvmInformation.getArguments()) {

View file

@ -39,14 +39,16 @@ public final class JvmImplementationName implements Placeholder {
public JvmImplementationName() {}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "jvm_implementation_name";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
return text.replace("%" + getName() + "%", JvmInformation.getImplementationName());
}
}

View file

@ -39,14 +39,16 @@ public final class JvmImplementationVendor implements Placeholder {
public JvmImplementationVendor() {}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "jvm_implementation_vendor";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
return text.replace("%" + getName() + "%", JvmInformation.getImplementationVendor());
}
}

View file

@ -39,14 +39,16 @@ public final class JvmImplementationVersion implements Placeholder {
public JvmImplementationVersion() {}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "jvm_implementation_version";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
return text.replace("%" + getName() + "%", JvmInformation.getImplementationVersion());
}
}

View file

@ -39,14 +39,16 @@ public final class JvmJava implements Placeholder {
public JvmJava() {}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "jvm_java";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
return text.replace("%" + getName() + "%", String.valueOf(JvmInformation.getJavaVersion()));
}
}

View file

@ -39,14 +39,16 @@ public final class JvmUptime implements Placeholder {
public JvmUptime() {}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "jvm_uptime";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
return text.replace("%" + getName() + "%", String.valueOf(JvmInformation.getUptime()));
}
}

View file

@ -50,14 +50,16 @@ public final class IssuerClass implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "issuer_class";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
return text.replace("%" + getName() + "%", logIssuer.getClazz().getName().replace(logIssuer.getClazz().getPackageName() + ".", ""));
}
}

View file

@ -50,14 +50,16 @@ public final class IssuerCodePart implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "issuer_code_part";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
return text.replace("%" + getName() + "%", logIssuer.getCodePart().name());
}
}

View file

@ -50,14 +50,16 @@ public final class IssuerInfo implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "issuer_info";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
if (logIssuer.getAdditionalInformation() == null)
return text.replace("%" + getName() + "%", "<none>");
else

View file

@ -49,14 +49,16 @@ public final class IssuerMessage implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "issuer_message";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
return text.replace("%" + getName() + "%", message);
}
}

View file

@ -50,14 +50,16 @@ public final class IssuerPackage implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "issuer_package";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
return text.replace("%" + getName() + "%", logIssuer.getClazz().getPackageName());
}
}

View file

@ -50,14 +50,16 @@ public final class IssuerPath implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "issuer_path";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
return text.replace("%" + getName() + "%", logIssuer.getClazz().getName());
}
}

View file

@ -51,14 +51,16 @@ public final class Stacktrace implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "stacktrace";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
if (throwable == null)
return text.replace("%" + getName() + "%", "No stacktrace is available.");
else {

View file

@ -50,14 +50,16 @@ public final class LogClass implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "log_class";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
return text.replace("%" + getName() + "%", logIssuer.getClazz().getName().replace(logIssuer.getClazz().getPackageName() + ".", ""));
}
}

View file

@ -50,14 +50,16 @@ public final class LogCodePart implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "log_code_part";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
return text.replace("%" + getName() + "%", logIssuer.getCodePart().name());
}
}

View file

@ -50,14 +50,16 @@ public final class LogColorPrimary implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "log_color_primary";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
String color;
switch (level) {

View file

@ -50,14 +50,16 @@ public final class LogColorSecondary implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "log_color_secondary";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
String color;
switch (level) {

View file

@ -50,14 +50,16 @@ public final class LogInfo implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "log_info";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
if (logIssuer.getAdditionalInformation() != null)
return text.replace("%" + getName() + "%", "/" + logIssuer.getAdditionalInformation());
return text.replace("%" + getName() + "%", "");

View file

@ -49,14 +49,16 @@ public final class LogLevel implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "log_level";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
String levelText;
switch (level) {

View file

@ -49,14 +49,16 @@ public final class LogMessage implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "log_message";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
return text.replace("%" + getName() + "%", message);
}
}

View file

@ -50,14 +50,16 @@ public final class LogPackage implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "log_package";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
return text.replace("%" + getName() + "%", logIssuer.getClazz().getPackageName());
}
}

View file

@ -50,14 +50,16 @@ public final class LogPath implements Placeholder {
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String getName() {
public String getName() {
return "log_path";
}
/** {@inheritDoc} */
@NotNull
@Override
public @NotNull String replace(@NotNull String text) {
public String replace(@NotNull String text) {
return text.replace("%" + getName() + "%", logIssuer.getClazz().getName());
}
}