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; private final int number4;
/** {@inheritDoc} */ /** {@inheritDoc} */
@NotNull
@Override @Override
public @NotNull String getName() { public String getName() {
return "n4"; return "n4";
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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