Class ConfigEntry<V>

java.lang.Object
nl.pim16aap2.animatedarchitecture.core.util.ConfigEntry<V>

public final class ConfigEntry<V> extends Object
Represents an option in a config file.
  • Constructor Details

    • ConfigEntry

      public ConfigEntry(IConfigReader config, String optionName, V defaultValue, @Nullable @Nullable String comment, @Nullable ConfigEntry.ITestValue<V> verifyValue)
      ConfigEntry Constructor.
      Parameters:
      config - The config file to read from.
      optionName - The name of this option as used in the config file.
      defaultValue - The default value of this option.
      comment - The comment that will precede this option.
      verifyValue - Function to use to verify the validity of a value and change it if necessary.
    • ConfigEntry

      public ConfigEntry(IConfigReader config, String optionName, V defaultValue, @Nullable @Nullable String comment)
      ConfigEntry Constructor.
      Parameters:
      config - The config file to read from.
      optionName - The name of this option as used in the config file.
      defaultValue - The default value of this option.
      comment - The comment that will precede this option.
  • Method Details

    • getValue

      public V getValue()
      Get the value of this config option.
      Returns:
      The value of the config option.
    • getComment

      @Nullable public @Nullable String getComment()
      Get the comment of this config option.
      Returns:
      The comment of the config option.
    • toString

      public String toString()
      Convert the comment, name and value(s) of this config option into a string that can be used for writing the config.
      Overrides:
      toString in class Object
      Returns:
      The config option formatted for printing in the config file