Record Class ConfigLoadResult

java.lang.Object
java.lang.Record
fr.robie.machineengine.api.config.ConfigLoadResult
Record Components:
created - the file did not exist and was written with every default
added - keys missing from the file, now written with their defaults
changed - keys whose value changed on this reload
restartRequired - restart-only keys changed in the file; they keep their old value until a restart
invalid - keys with an invalid value; they use their default and the file is left as it is
error - why the file could not be read (every value is then kept, or the default on the first load)

public record ConfigLoadResult(boolean created, @NotNull List<String> added, @NotNull List<String> changed, @NotNull List<String> restartRequired, @NotNull List<String> invalid, @Nullable String error) extends Record
What a load or reload of a ConfigFile did. Lists hold key paths.
  • Constructor Details

    • ConfigLoadResult

      public ConfigLoadResult(boolean created, @NotNull @NotNull List<String> added, @NotNull @NotNull List<String> changed, @NotNull @NotNull List<String> restartRequired, @NotNull @NotNull List<String> invalid, @Nullable @Nullable String error)
      Creates an instance of a ConfigLoadResult record class.
      Parameters:
      created - the value for the created record component
      added - the value for the added record component
      changed - the value for the changed record component
      restartRequired - the value for the restartRequired record component
      invalid - the value for the invalid record component
      error - the value for the error record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • created

      public boolean created()
      Returns the value of the created record component.
      Returns:
      the value of the created record component
    • added

      @NotNull public @NotNull List<String> added()
      Returns the value of the added record component.
      Returns:
      the value of the added record component
    • changed

      @NotNull public @NotNull List<String> changed()
      Returns the value of the changed record component.
      Returns:
      the value of the changed record component
    • restartRequired

      @NotNull public @NotNull List<String> restartRequired()
      Returns the value of the restartRequired record component.
      Returns:
      the value of the restartRequired record component
    • invalid

      @NotNull public @NotNull List<String> invalid()
      Returns the value of the invalid record component.
      Returns:
      the value of the invalid record component
    • error

      @Nullable public @Nullable String error()
      Returns the value of the error record component.
      Returns:
      the value of the error record component