Class ConfigEntry<V>
java.lang.Object
nl.pim16aap2.animatedarchitecture.core.util.ConfigEntry<V>
Represents an option in a config file.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface that can be used to verify config values. -
Constructor Summary
ConstructorsConstructorDescriptionConfigEntry(IConfigReader config, String optionName, V defaultValue, @Nullable String comment) ConfigEntry Constructor.ConfigEntry(IConfigReader config, String optionName, V defaultValue, @Nullable String comment, ConfigEntry.ITestValue<V> verifyValue) ConfigEntry Constructor. -
Method Summary
-
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
Get the value of this config option.- Returns:
- The value of the config option.
-
getComment
Get the comment of this config option.- Returns:
- The comment of the config option.
-
toString
Convert the comment, name and value(s) of this config option into a string that can be used for writing the config.
-