net.minecraftforge.common.config

## Class Property

- java.lang.Object
- - net.minecraftforge.common.config.Property

-     public class Property
      extends java.lang.Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Property.Type`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.lang.String` | `comment`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Property(java.lang.String name, java.lang.String[] values, Property.Type type)`
    `Property(java.lang.String name, java.lang.String[] values, Property.Type type, java.lang.String langKey)`
    `Property(java.lang.String name, java.lang.String value, Property.Type type)`
    `Property(java.lang.String name, java.lang.String value, Property.Type type, boolean read)`
    `Property(java.lang.String name, java.lang.String value, Property.Type type, boolean read, java.lang.String langKey)`
    `Property(java.lang.String name, java.lang.String value, Property.Type type, java.lang.String langKey)`
    `Property(java.lang.String name, java.lang.String value, Property.Type type, java.lang.String[] validValues)`
    `Property(java.lang.String name, java.lang.String value, Property.Type type, java.lang.String[] validValues, java.lang.String langKey)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Class<? extends GuiEditArrayEntries.IArrayEntry>` | `getArrayEntryClass()` Gets the custom IArrayEntry class that should be used in place of the standard entry class for this Property type, or null if none has been set.
    `boolean` | `getBoolean()` Returns the value in this property as a boolean, if the value is not a valid boolean, it will return the provided default.
    `boolean` | `getBoolean(boolean _default)` Returns the value in this property as a boolean, if the value is not a valid boolean, it will return the provided default.
    `boolean[]` | `getBooleanList()` Returns the boolean value of all values that can be parsed in the list.
    `java.lang.Class<? extends GuiConfigEntries.IConfigEntry>` | `getConfigEntryClass()` Gets the custom IConfigEntry class that should be used in place of the standard entry class for this Property type, or null if none has been set.
    `java.lang.String` | `getDefault()` Gets the raw String default value of this Property.
    `java.lang.String[]` | `getDefaults()` Gets the raw String[] default values of this Property.
    `double` | `getDouble()` Returns the value in this property as a double, if the value is not a valid double, it will return the provided default.
    `double` | `getDouble(double _default)` Returns the value in this property as a double, if the value is not a valid double, it will return the provided default.
    `double[]` | `getDoubleList()` Returns the double value of all values that can be parsed in the list.
    `int` | `getInt()` Returns the value in this property as an integer, if the value is not a valid integer, it will return the initially provided default.
    `int` | `getInt(int _default)` Returns the value in this property as an integer, if the value is not a valid integer, it will return the provided default.
    `int[]` | `getIntList()` Returns the integer value of all values that can be parsed in the list.
    `java.lang.String` | `getLanguageKey()` Gets the language key string for this Property.
    `int` | `getMaxListLength()` Gets the maximum length of this list/array Property.
    `java.lang.String` | `getMaxValue()` Gets the maximum value.
    `java.lang.String` | `getMinValue()` Gets the minimum value.
    `java.lang.String` | `getName()` Gets the name/key for this Property.
    `java.lang.String` | `getString()` Returns the value in this property as it's raw string.
    `java.lang.String[]` | `getStringList()`
    `Property.Type` | `getType()` Gets the Property.Type enum value for this Property.
    `java.util.regex.Pattern` | `getValidationPattern()` Gets the Pattern object used to validate user input for this Property.
    `java.lang.String[]` | `getValidValues()` Gets the array of valid values that this String Property can be set to, or null if not defined.
    `boolean` | `hasChanged()` Gets the changed status of this Property.
    `boolean` | `isBooleanList()` Checks if all of current values stored in this property can be converted to a boolean.
    `boolean` | `isBooleanValue()` Checks if the current value held by this property is a valid boolean value.
    `boolean` | `isDefault()` Returns whether or not this Property is defaulted.
    `boolean` | `isDoubleList()` Checks if all of the current values stored in this property can be converted to a double.
    `boolean` | `isDoubleValue()` Checks if the current value held by this property is a valid double value.
    `boolean` | `isIntList()` Checks if all of the current values stored in this property can be converted to an integer.
    `boolean` | `isIntValue()` Checks if the current value stored in this property can be converted to an integer.
    `boolean` | `isList()` Returns whether or not this Property is a list/array.
    `boolean` | `isListLengthFixed()` Returns whether or not this list/array has a fixed length.
    `boolean` | `requiresMcRestart()` Gets whether or not this Property requires Minecraft to be restarted when changed.
    `boolean` | `requiresWorldRestart()` Returns whether or not this Property is able to be edited while a world is running using the in-game Mod Options screen as well as the Mods list screen, or only from the Mods list screen.
    `void` | `set(boolean value)`
    `void` | `set(boolean[] values)`
    `void` | `set(double value)`
    `void` | `set(double[] values)`
    `void` | `set(int value)`
    `void` | `set(int[] values)`
    `void` | `set(java.lang.String value)`
    `void` | `set(java.lang.String[] values)`
    `Property` | `setArrayEntryClass(java.lang.Class<? extends GuiEditArrayEntries.IArrayEntry> clazz)` Sets a custom IGuiEditListEntry class that should be used in place of the standard entry class for this Property type.
    `Property` | `setConfigEntryClass(java.lang.Class<? extends GuiConfigEntries.IConfigEntry> clazz)` Sets a custom IConfigEntry class that should be used in place of the standard entry class for this Property type.
    `Property` | `setDefaultValue(boolean defaultValue)` Sets the default boolean value of this Property.
    `Property` | `setDefaultValue(double defaultValue)` Sets the default double value of this Property.
    `Property` | `setDefaultValue(int defaultValue)` Sets the default int value of this Property.
    `Property` | `setDefaultValue(java.lang.String defaultValue)` Sets the default string value of this Property.
    `Property` | `setDefaultValues(boolean[] defaultValues)` Sets the default boolean[] values of this Property.
    `Property` | `setDefaultValues(double[] defaultValues)` Sets the default double[] values of this Property
    `Property` | `setDefaultValues(int[] defaultValues)` Sets the default int[] values of this Property.
    `Property` | `setDefaultValues(java.lang.String[] defaultValues)` Sets the default String[] values of this Property.
    `Property` | `setIsListLengthFixed(boolean isListLengthFixed)` Sets the flag for whether this list/array Property has a fixed length.
    `Property` | `setLanguageKey(java.lang.String langKey)` Sets the localization language key for this Property so that the config GUI screens are nice and pretty <3.
    `Property` | `setMaxListLength(int max)` Sets the maximum length of this list/array Property.
    `Property` | `setMaxValue(double maxValue)` Sets the maximum double value of this Property.
    `Property` | `setMaxValue(int maxValue)` Sets the maximum int value of this Property.
    `Property` | `setMinValue(double minValue)` Sets the minimum double value of this Property.
    `Property` | `setMinValue(int minValue)` Sets the minimum int value of this Property.
    `void` | `setName(java.lang.String name)` Sets the name/key for this Property.
    `Property` | `setRequiresMcRestart(boolean requiresMcRestart)` Sets whether or not this Property requires Minecraft to be restarted when changed.
    `Property` | `setRequiresWorldRestart(boolean requiresWorldRestart)` Sets the flag for whether or not this Property can be edited while a world is running.
    `Property` | `setShowInGui(boolean showInGui)` Sets whether or not this Property should be allowed to show on config GUIs.
    `Property` | `setToDefault()` Sets the current value(s) of this Property to the default value(s).
    `Property` | `setValidationPattern(java.util.regex.Pattern validationPattern)` Sets a regex Pattern object used to validate user input for formatted String or String[] properties.
    `Property` | `setValidValues(java.lang.String[] validValues)` Sets the array of valid values that this String Property can be set to.
    `Property` | `setValue(boolean value)` Sets the value of this Property to the provided boolean value.
    `Property` | `setValue(double value)` Sets the value of this Property to the provided double value.
    `Property` | `setValue(int value)` Sets the value of this Property to the provided int value.
    `Property` | `setValue(java.lang.String value)` Sets the value of this Property to the provided String value.
    `Property` | `setValues(boolean[] values)` Sets the values of this Property to the provided boolean[] values.
    `Property` | `setValues(double[] values)` Sets the values of this Property to the provided double[] values.
    `Property` | `setValues(int[] values)` Sets the values of this Property to the provided int[] values.
    `Property` | `setValues(java.lang.String[] values)` Sets the values of this Property to the provided String[] values.
    `boolean` | `showInGui()` Gets whether or not this Property should be allowed to show on config GUIs.
    `boolean` | `wasRead()` Determines if this config value was just created, or if it was read from the config file.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### comment

          public java.lang.String comment

  - ### Constructor Detail

    - #### Property

          public Property(java.lang.String name,
                  java.lang.String value,
                  Property.Type type)

    - #### Property

          public Property(java.lang.String name,
                  java.lang.String value,
                  Property.Type type,
                  boolean read)

    - #### Property

          public Property(java.lang.String name,
                  java.lang.String value,
                  Property.Type type,
                  java.lang.String[] validValues)

    - #### Property

          public Property(java.lang.String name,
                  java.lang.String value,
                  Property.Type type,
                  java.lang.String langKey)

    - #### Property

          public Property(java.lang.String name,
                  java.lang.String value,
                  Property.Type type,
                  boolean read,
                  java.lang.String langKey)

    - #### Property

          public Property(java.lang.String name,
                  java.lang.String value,
                  Property.Type type,
                  java.lang.String[] validValues,
                  java.lang.String langKey)

    - #### Property

          public Property(java.lang.String name,
                  java.lang.String[] values,
                  Property.Type type)

    - #### Property

          public Property(java.lang.String name,
                  java.lang.String[] values,
                  Property.Type type,
                  java.lang.String langKey)

  - ### Method Detail

    - #### isDefault

          public boolean isDefault()

      Returns whether or not this Property is defaulted.
      Returns:
        true if the current value(s) is(are) deeply equal to the default value(s)

    - #### setToDefault

          public Property setToDefault()

      Sets the current value(s) of this Property to the default value(s).

    - #### getDefault

          public java.lang.String getDefault()

      Gets the raw String default value of this Property. Check for isList() == false first.
      Returns:
        the default value String

    - #### getDefaults

          public java.lang.String[] getDefaults()

      Gets the raw String[] default values of this Property. Check for isList() == true first.
      Returns:
        the default values String[]

    - #### setRequiresWorldRestart

          public Property setRequiresWorldRestart(boolean requiresWorldRestart)

      Sets the flag for whether or not this Property can be edited while a world is running. Care should be taken to ensure that only properties that are truly dynamic can be changed from the in-game options menu. When set to false the Property will be editable from both the main menu Mods list config screen and the in-game Mod Options config screen. When set to true the Property will only be editable from the main menu Mods list config screen.

    - #### requiresWorldRestart

          public boolean requiresWorldRestart()

      Returns whether or not this Property is able to be edited while a world is running using the in-game Mod Options screen as well as the Mods list screen, or only from the Mods list screen. Setting this flag to true will disable editing of this property while a world is running.

    - #### setShowInGui

          public Property setShowInGui(boolean showInGui)

      Sets whether or not this Property should be allowed to show on config GUIs. Defaults to true.

    - #### showInGui

          public boolean showInGui()

      Gets whether or not this Property should be allowed to show on config GUIs. Defaults to true unless set to false.

    - #### setRequiresMcRestart

          public Property setRequiresMcRestart(boolean requiresMcRestart)

      Sets whether or not this Property requires Minecraft to be restarted when changed. Defaults to false. Setting this flag to true will also disable editing of this property while a world is running.

    - #### requiresMcRestart

          public boolean requiresMcRestart()

      Gets whether or not this Property requires Minecraft to be restarted when changed. Defaults to false unless set to true.

    - #### setMaxListLength

          public Property setMaxListLength(int max)

      Sets the maximum length of this list/array Property. Only important if isList() == true. If the current values array or default values array is longer than the new maximum it will be resized. If calling both this method and setIsListLengthFixed(true), this method should be called afterwards (but is not required).

    - #### getMaxListLength

          public int getMaxListLength()

      Gets the maximum length of this list/array Property. Only important if isList() == true.

    - #### setIsListLengthFixed

          public Property setIsListLengthFixed(boolean isListLengthFixed)

      Sets the flag for whether this list/array Property has a fixed length. Only important if isList() == true. If calling both this method and setMaxListLength(), this method should be called first (but is not required).

    - #### isListLengthFixed

          public boolean isListLengthFixed()

      Returns whether or not this list/array has a fixed length. Only important if isList() == true.

    - #### setConfigEntryClass

          public Property setConfigEntryClass(java.lang.Class<? extends GuiConfigEntries.IConfigEntry> clazz)

      Sets a custom IConfigEntry class that should be used in place of the standard entry class for this Property type. This class MUST provide a constructor with the following parameter types: `GuiConfig` (the owning GuiConfig screen will be provided), `GuiConfigEntries` (the owning GuiConfigEntries will be provided), `IConfigElement` (the IConfigElement for this Property will be provided).

    - #### getConfigEntryClass

          public java.lang.Class<? extends GuiConfigEntries.IConfigEntry> getConfigEntryClass()

      Gets the custom IConfigEntry class that should be used in place of the standard entry class for this Property type, or null if none has been set.
      Returns:
        a class that implements IConfigEntry

    - #### setArrayEntryClass

          public Property setArrayEntryClass(java.lang.Class<? extends GuiEditArrayEntries.IArrayEntry> clazz)

      Sets a custom IGuiEditListEntry class that should be used in place of the standard entry class for this Property type. This class MUST provide a constructor with the following parameter types: `GuiEditList` (the owning GuiEditList screen will be provided), `GuiPropertyList` (the parent GuiPropertyList will be provided), `IConfigProperty` (the IConfigProperty for this Property will be provided).
      Parameters:
        `clazz` - a class that implements IConfigEntry

    - #### getArrayEntryClass

          public java.lang.Class<? extends GuiEditArrayEntries.IArrayEntry> getArrayEntryClass()

      Gets the custom IArrayEntry class that should be used in place of the standard entry class for this Property type, or null if none has been set.
      Returns:
        a class that implements IArrayEntry

    - #### setValidationPattern

          public Property setValidationPattern(java.util.regex.Pattern validationPattern)

      Sets a regex Pattern object used to validate user input for formatted String or String[] properties.
      Parameters:
        `validationPattern` -

    - #### getValidationPattern

          public java.util.regex.Pattern getValidationPattern()

      Gets the Pattern object used to validate user input for this Property.
      Returns:
        the user input validation Pattern object, or null if none is set

    - #### setLanguageKey

          public Property setLanguageKey(java.lang.String langKey)

      Sets the localization language key for this Property so that the config GUI screens are nice and pretty <3. The string languageKey + ".tooltip" is used for tooltips when a user hovers the mouse over a GUI property label.
      Parameters:
        `langKey` - a string language key such as myawesomemod.config.myPropName

    - #### getLanguageKey

          public java.lang.String getLanguageKey()

      Gets the language key string for this Property.
      Returns:
        the language key

    - #### setDefaultValue

          public Property setDefaultValue(java.lang.String defaultValue)

      Sets the default string value of this Property.
      Parameters:
        `defaultValue` - a String value

    - #### setDefaultValues

          public Property setDefaultValues(java.lang.String[] defaultValues)

      Sets the default String[] values of this Property.
      Parameters:
        `defaultValues` - an array of String values

    - #### setDefaultValue

          public Property setDefaultValue(int defaultValue)

      Sets the default int value of this Property.
      Parameters:
        `defaultValue` - an int value

    - #### setDefaultValues

          public Property setDefaultValues(int[] defaultValues)

      Sets the default int[] values of this Property.
      Parameters:
        `defaultValues` - an array of int values

    - #### setDefaultValue

          public Property setDefaultValue(double defaultValue)

      Sets the default double value of this Property.
      Parameters:
        `defaultValue` - a double value

    - #### setDefaultValues

          public Property setDefaultValues(double[] defaultValues)

      Sets the default double[] values of this Property
      Parameters:
        `defaultValues` - an array of double values

    - #### setDefaultValue

          public Property setDefaultValue(boolean defaultValue)

      Sets the default boolean value of this Property.
      Parameters:
        `defaultValue` - a boolean value

    - #### setDefaultValues

          public Property setDefaultValues(boolean[] defaultValues)

      Sets the default boolean[] values of this Property.
      Parameters:
        `defaultValues` - an array of boolean values

    - #### setMinValue

          public Property setMinValue(int minValue)

      Sets the minimum int value of this Property.
      Parameters:
        `minValue` - an int value

    - #### setMaxValue

          public Property setMaxValue(int maxValue)

      Sets the maximum int value of this Property.
      Parameters:
        `maxValue` - an int value

    - #### setMinValue

          public Property setMinValue(double minValue)

      Sets the minimum double value of this Property.
      Parameters:
        `minValue` - a double value

    - #### setMaxValue

          public Property setMaxValue(double maxValue)

      Sets the maximum double value of this Property.
      Parameters:
        `maxValue` - a double value

    - #### getMinValue

          public java.lang.String getMinValue()

      Gets the minimum value.
      Returns:
        the minimum value bound

    - #### getMaxValue

          public java.lang.String getMaxValue()

      Gets the maximum value.
      Returns:
        the maximum value bound

    - #### getString

          public java.lang.String getString()

      Returns the value in this property as it's raw string.
      Returns:
        current value

    - #### setValidValues

          public Property setValidValues(java.lang.String[] validValues)

      Sets the array of valid values that this String Property can be set to. When an array of valid values is defined for a Property the GUI control for that property will be a value cycle button.
      Parameters:
        `validValues` - a String array of valid values

    - #### getValidValues

          public java.lang.String[] getValidValues()

      Gets the array of valid values that this String Property can be set to, or null if not defined.
      Returns:
        a String array of valid values

    - #### getInt

          public int getInt()

      Returns the value in this property as an integer, if the value is not a valid integer, it will return the initially provided default.
      Returns:
        The value

    - #### getInt

          public int getInt(int _default)

      Returns the value in this property as an integer, if the value is not a valid integer, it will return the provided default.
      Parameters:
        `_default` - The default to provide if the current value is not a valid integer
      Returns:
        The value

    - #### isIntValue

          public boolean isIntValue()

      Checks if the current value stored in this property can be converted to an integer.
      Returns:
        True if the type of the Property is an Integer

    - #### getBoolean

          public boolean getBoolean(boolean _default)

      Returns the value in this property as a boolean, if the value is not a valid boolean, it will return the provided default.
      Parameters:
        `_default` - The default to provide
      Returns:
        The value as a boolean, or the default

    - #### getBoolean

          public boolean getBoolean()

      Returns the value in this property as a boolean, if the value is not a valid boolean, it will return the provided default.
      Returns:
        The value as a boolean, or the default

    - #### isBooleanValue

          public boolean isBooleanValue()

      Checks if the current value held by this property is a valid boolean value.
      Returns:
        True if it is a boolean value

    - #### isDoubleValue

          public boolean isDoubleValue()

      Checks if the current value held by this property is a valid double value.
      Returns:
        True if the value can be converted to an double

    - #### getDouble

          public double getDouble(double _default)

      Returns the value in this property as a double, if the value is not a valid double, it will return the provided default.
      Parameters:
        `_default` - The default to provide if the current value is not a valid double
      Returns:
        The value

    - #### getDouble

          public double getDouble()

      Returns the value in this property as a double, if the value is not a valid double, it will return the provided default.
      Parameters:
        `_default` - The default to provide if the current value is not a valid double
      Returns:
        The value

    - #### getStringList

          public java.lang.String[] getStringList()

    - #### getIntList

          public int[] getIntList()

      Returns the integer value of all values that can be parsed in the list.
      Returns:
        Array of length 0 if none of the values could be parsed.

    - #### isIntList

          public boolean isIntList()

      Checks if all of the current values stored in this property can be converted to an integer.
      Returns:
        True if the type of the Property is an Integer List

    - #### getBooleanList

          public boolean[] getBooleanList()

      Returns the boolean value of all values that can be parsed in the list.
      Returns:
        Array of length 0 if none of the values could be parsed.

    - #### isBooleanList

          public boolean isBooleanList()

      Checks if all of current values stored in this property can be converted to a boolean.
      Returns:
        True if it is a boolean value

    - #### getDoubleList

          public double[] getDoubleList()

      Returns the double value of all values that can be parsed in the list.
      Returns:
        Array of length 0 if none of the values could be parsed.

    - #### isDoubleList

          public boolean isDoubleList()

      Checks if all of the current values stored in this property can be converted to a double.
      Returns:
        True if the type of the Property is a double List

    - #### getName

          public java.lang.String getName()

      Gets the name/key for this Property.
      Returns:
        the Property name

    - #### setName

          public void setName(java.lang.String name)

      Sets the name/key for this Property.
      Parameters:
        `name` - a name

    - #### wasRead

          public boolean wasRead()

      Determines if this config value was just created, or if it was read from the config file. This is useful for mods who auto-assign their blocks to determine if the ID returned is a configured one, or a automatically generated one.
      Returns:
        True if this property was loaded from the config file with a value

    - #### getType

          public Property.Type getType()

      Gets the Property.Type enum value for this Property.
      Returns:
        the Property's type

    - #### isList

          public boolean isList()

      Returns whether or not this Property is a list/array.
      Returns:
        true if this Property is a list/array, false otherwise

    - #### hasChanged

          public boolean hasChanged()

      Gets the changed status of this Property.
      Returns:
        true if this Property has changed, false otherwise

    - #### setValue

          public Property setValue(java.lang.String value)

      Sets the value of this Property to the provided String value.

    - #### set

          public void set(java.lang.String value)

    - #### setValues

          public Property setValues(java.lang.String[] values)

      Sets the values of this Property to the provided String[] values.

    - #### set

          public void set(java.lang.String[] values)

    - #### setValue

          public Property setValue(int value)

      Sets the value of this Property to the provided int value.

    - #### setValue

          public Property setValue(boolean value)

      Sets the value of this Property to the provided boolean value.

    - #### setValue

          public Property setValue(double value)

      Sets the value of this Property to the provided double value.

    - #### setValues

          public Property setValues(boolean[] values)

      Sets the values of this Property to the provided boolean[] values.

    - #### set

          public void set(boolean[] values)

    - #### setValues

          public Property setValues(int[] values)

      Sets the values of this Property to the provided int[] values.

    - #### set

          public void set(int[] values)

    - #### setValues

          public Property setValues(double[] values)

      Sets the values of this Property to the provided double[] values.

    - #### set

          public void set(double[] values)

    - #### set

          public void set(int value)

    - #### set

          public void set(boolean value)

    - #### set

          public void set(double value)