diff --git a/XPlat/src/main/java/de/wonejo/wuidebook/api/config/ConfigFile.java b/XPlat/src/main/java/de/wonejo/wuidebook/api/config/ConfigFile.java index 8b28bab..3c036fe 100644 --- a/XPlat/src/main/java/de/wonejo/wuidebook/api/config/ConfigFile.java +++ b/XPlat/src/main/java/de/wonejo/wuidebook/api/config/ConfigFile.java @@ -17,8 +17,7 @@ public interface ConfigFile { * Create a {@link Builder} * @since 4.0.0-dev2 */ - @NotNull - static Builder createBuilder () { + @NotNull static Builder createBuilder () { return ConfigFileImpl.createBuilderImpl(); } diff --git a/XPlat/src/main/java/de/wonejo/wuidebook/impl/config/ConfigFileImpl.java b/XPlat/src/main/java/de/wonejo/wuidebook/impl/config/ConfigFileImpl.java index ae9d905..0096444 100644 --- a/XPlat/src/main/java/de/wonejo/wuidebook/impl/config/ConfigFileImpl.java +++ b/XPlat/src/main/java/de/wonejo/wuidebook/impl/config/ConfigFileImpl.java @@ -28,8 +28,7 @@ public class ConfigFileImpl implements ConfigFile { - @NotNull - public static Builder createBuilderImpl () { + @NotNull public static Builder createBuilderImpl () { return new BuilderImpl(); } @@ -88,10 +87,10 @@ private void tryToLoadFile () { } } catch ( IOException pException ) { LOGGER.error(this.exceptionFactory.createException(this, "Reading the file send an error.. why?",pException)); - this.broken = this.broken.turnTrue(); + this.broken = TriState.TRUE; } - this.fileLoaded = this.fileLoaded.turnTrue(); + this.fileLoaded = TriState.TRUE; } private void tryToAdditionFile () { @@ -110,7 +109,7 @@ private void tryToAdditionFile () { } } catch (IOException e) { LOGGER.error(this.exceptionFactory.createException(this, "Reading the keys of the file seems to show an error, weird.",e)); - this.broken = this.broken.turnTrue(); + this.broken = TriState.TRUE; } if (this.broken.isTrue()) return; @@ -140,7 +139,7 @@ private void tryToAdditionFile () { } } catch (IOException pException) { LOGGER.error(this.exceptionFactory.createException(this, "Addition of missing keys just send a error? What.", pException)); - this.broken = this.broken.turnTrue(); + this.broken = TriState.TRUE; } } @@ -165,7 +164,7 @@ private void createFileIfNeeded () { } } catch (IOException pException) { LOGGER.error(this.exceptionFactory.createException(this, "Some error must happened when creating file! What could it be D:? ", pException)); - this.broken = this.broken.turnTrue(); + this.broken = TriState.TRUE; } } @@ -279,8 +278,7 @@ public ConfigSpecGetter ( @NotNull BufferedReader pReader, Collection ConfigSpec getSpec(String pKey) { + @Nullable public ConfigSpec getSpec(String pKey) { ConfigSpec providerSpec = (ConfigSpec) this.providerSpecs.stream().filter((spec2) -> spec2.key().equals(pKey)).findFirst().orElse(null); if (providerSpec == null) return null;