net.minecraftforge.common.config

## Class ConfigElement<T>

- java.lang.Object
- - net.minecraftforge.common.config.ConfigElement<T>

- All Implemented Interfaces:
    IConfigElement<T>

      public class ConfigElement<T>
      extends java.lang.Object
      implements IConfigElement<T>

  This class bridges the gap between the FML config GUI classes and the Forge Configuration classes.

- - ### Property Summary

    Properties
    Type | Property and Description
    --- | ---
    `boolean` | `is` [Property, Category] Is this object a property object?

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConfigElement(ConfigCategory ctgy)`
    `ConfigElement(Property prop)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `get()` [Property] Gets this property value.
    `java.lang.Class<? extends GuiEditArrayEntries.IArrayEntry>` | `getArrayEntryClass()` This method returns a class that implements `IArrayEntry`.
    `java.util.List<IConfigElement>` | `getChildElements()` [Category] Gets this category's child categories/properties.
    `java.lang.String` | `getComment()` [Property, Category] Gets the comment for this object.
    `java.lang.Class<? extends GuiConfigEntries.IConfigEntry>` | `getConfigEntryClass()` This method returns a class that implements `IConfigEntry` or null.
    `java.lang.Object` | `getDefault()` [Property] Gets this property's default value.
    `java.lang.Object[]` | `getDefaults()` [Property] Gets this property's default values.
    `java.lang.String` | `getLanguageKey()` [Property, Category] Gets a language key for localization of config GUI entry names.
    `java.lang.Object[]` | `getList()` [Property] Gets this property value as a list.
    `int` | `getMaxListLength()` [Property] Gets the max length of this list property, or -1 if the length is unlimited.
    `T` | `getMaxValue()` [Property] Gets this property's maximum value.
    `T` | `getMinValue()` [Property] Gets this property's minimum value.
    `java.lang.String` | `getName()` [Property, Category] Gets the name of this object.
    `java.lang.String` | `getQualifiedName()` [Category] Gets the qualified name of this object.
    `ConfigGuiType` | `getType()` [Property, Category] Gets the ConfigGuiType value corresponding to the type of this property object, or CONFIG_CATEGORY if this is a category object.
    `static ConfigGuiType` | `getType(Property prop)`
    `static ConfigElement<?>` | `getTypedElement(Property prop)`
    `java.util.regex.Pattern` | `getValidationPattern()` [Property] Gets a Pattern object used in String property input validation.
    `java.lang.String[]` | `getValidValues()` [Property] Gets a String array of valid values for this property.
    `boolean` | `isDefault()` [Property] Is this property value equal to the default value?
    `boolean` | `isList()` [Property] Is this property object a list?
    `boolean` | `isListLengthFixed()` [Property] Does this list property have to remain a fixed length?
    `boolean` | `isProperty()` [Property, Category] Is this object a property object?
    `ConfigElement<T>` | `listCategoriesFirst(boolean categoriesFirst)`
    `boolean` | `requiresMcRestart()` [Property, Category] Whether or not this element requires Minecraft to be restarted when changed.
    `boolean` | `requiresWorldRestart()` [Property, Category] Whether or not this element is safe to modify while a world is running.
    `void` | `set(T value)` [Property] Sets this property's value.
    `void` | `set(T[] aVal)` [Property] Sets this property's value to the specified array.
    `void` | `setToDefault()` [Property] Sets this property's value to the default value.
    `boolean` | `showInGui()` [Property, Category] Whether or not this element should be allowed to show on config GUIs.

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

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

- - ### Property Detail

    - #### is

      Specified by:
        `isProperty` in interface `IConfigElement<T>`

  - ### Constructor Detail

    - #### ConfigElement

          public ConfigElement(ConfigCategory ctgy)

    - #### ConfigElement

          public ConfigElement(Property prop)

  - ### Method Detail

    - #### listCategoriesFirst

          public ConfigElement<T> listCategoriesFirst(boolean categoriesFirst)

    - #### getChildElements

          public java.util.List<IConfigElement> getChildElements()

      Description copied from interface: `IConfigElement`
      [Category] Gets this category's child categories/properties.
      Specified by:
        `getChildElements` in interface `IConfigElement<T>`

    - #### getTypedElement

          public static ConfigElement<?> getTypedElement(Property prop)

    - #### getName

          public java.lang.String getName()

      Description copied from interface: `IConfigElement`
      [Property, Category] Gets the name of this object.
      Specified by:
        `getName` in interface `IConfigElement<T>`

    - #### isProperty

          public boolean isProperty()

      Description copied from interface: `IConfigElement`
      [Property, Category] Is this object a property object?
      Specified by:
        `isProperty` in interface `IConfigElement<T>`

    - #### getConfigEntryClass

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

      Description copied from interface: `IConfigElement`
      This method returns a class that implements `IConfigEntry` or null. This class MUST provide a constructor with the following parameter types: `GuiConfig`, `GuiConfigEntries`, `IConfigElement`
      Specified by:
        `getConfigEntryClass` in interface `IConfigElement<T>`

    - #### getArrayEntryClass

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

      Description copied from interface: `IConfigElement`
      This method returns a class that implements `IArrayEntry`. This class MUST provide a constructor with the following parameter types: `GuiEditArray`, `GuiEditArrayEntries`, `IConfigElement`, `Object`
      Specified by:
        `getArrayEntryClass` in interface `IConfigElement<T>`

    - #### getQualifiedName

          public java.lang.String getQualifiedName()

      Description copied from interface: `IConfigElement`
      [Category] Gets the qualified name of this object. This is typically only used for category objects.
      Specified by:
        `getQualifiedName` in interface `IConfigElement<T>`

    - #### getType

          public ConfigGuiType getType()

      Description copied from interface: `IConfigElement`
      [Property, Category] Gets the ConfigGuiType value corresponding to the type of this property object, or CONFIG_CATEGORY if this is a category object.
      Specified by:
        `getType` in interface `IConfigElement<T>`

    - #### getType

          public static ConfigGuiType getType(Property prop)

    - #### isList

          public boolean isList()

      Description copied from interface: `IConfigElement`
      [Property] Is this property object a list?
      Specified by:
        `isList` in interface `IConfigElement<T>`

    - #### isListLengthFixed

          public boolean isListLengthFixed()

      Description copied from interface: `IConfigElement`
      [Property] Does this list property have to remain a fixed length?
      Specified by:
        `isListLengthFixed` in interface `IConfigElement<T>`

    - #### getMaxListLength

          public int getMaxListLength()

      Description copied from interface: `IConfigElement`
      [Property] Gets the max length of this list property, or -1 if the length is unlimited.
      Specified by:
        `getMaxListLength` in interface `IConfigElement<T>`

    - #### getComment

          public java.lang.String getComment()

      Description copied from interface: `IConfigElement`
      [Property, Category] Gets the comment for this object. Used for the tooltip if getLanguageKey() + ".tooltip" is not defined in the .lang file.
      Specified by:
        `getComment` in interface `IConfigElement<T>`

    - #### isDefault

          public boolean isDefault()

      Description copied from interface: `IConfigElement`
      [Property] Is this property value equal to the default value?
      Specified by:
        `isDefault` in interface `IConfigElement<T>`

    - #### setToDefault

          public void setToDefault()

      Description copied from interface: `IConfigElement`
      [Property] Sets this property's value to the default value.
      Specified by:
        `setToDefault` in interface `IConfigElement<T>`

    - #### requiresWorldRestart

          public boolean requiresWorldRestart()

      Description copied from interface: `IConfigElement`
      [Property, Category] Whether or not this element is safe to modify while a world is running. For Categories return false if ANY properties in the category are modifiable while a world is running, true if all are not.
      Specified by:
        `requiresWorldRestart` in interface `IConfigElement<T>`

    - #### showInGui

          public boolean showInGui()

      Description copied from interface: `IConfigElement`
      [Property, Category] Whether or not this element should be allowed to show on config GUIs.
      Specified by:
        `showInGui` in interface `IConfigElement<T>`

    - #### requiresMcRestart

          public boolean requiresMcRestart()

      Description copied from interface: `IConfigElement`
      [Property, Category] Whether or not this element requires Minecraft to be restarted when changed.
      Specified by:
        `requiresMcRestart` in interface `IConfigElement<T>`

    - #### getValidValues

          public java.lang.String[] getValidValues()

      Description copied from interface: `IConfigElement`
      [Property] Gets a String array of valid values for this property. This is generally used for String properties to allow the user to select a value from a list of valid values.
      Specified by:
        `getValidValues` in interface `IConfigElement<T>`

    - #### getLanguageKey

          public java.lang.String getLanguageKey()

      Description copied from interface: `IConfigElement`
      [Property, Category] Gets a language key for localization of config GUI entry names. If the same key is specified with .tooltip appended to the end, that key will return a localized tooltip when the mouse hovers over the property label/category button.
      Specified by:
        `getLanguageKey` in interface `IConfigElement<T>`

    - #### getDefault

          public java.lang.Object getDefault()

      Description copied from interface: `IConfigElement`
      [Property] Gets this property's default value. If this element is an array, this method should return a String representation of that array using Arrays.toString()
      Specified by:
        `getDefault` in interface `IConfigElement<T>`

    - #### getDefaults

          public java.lang.Object[] getDefaults()

      Description copied from interface: `IConfigElement`
      [Property] Gets this property's default values.
      Specified by:
        `getDefaults` in interface `IConfigElement<T>`

    - #### getValidationPattern

          public java.util.regex.Pattern getValidationPattern()

      Description copied from interface: `IConfigElement`
      [Property] Gets a Pattern object used in String property input validation.
      Specified by:
        `getValidationPattern` in interface `IConfigElement<T>`

    - #### get

          public java.lang.Object get()

      Description copied from interface: `IConfigElement`
      [Property] Gets this property value.
      Specified by:
        `get` in interface `IConfigElement<T>`

    - #### getList

          public java.lang.Object[] getList()

      Description copied from interface: `IConfigElement`
      [Property] Gets this property value as a list. Generally you should be sure of whether the property is a list before calling this.
      Specified by:
        `getList` in interface `IConfigElement<T>`

    - #### set

          public void set(T value)

      Description copied from interface: `IConfigElement`
      [Property] Sets this property's value.
      Specified by:
        `set` in interface `IConfigElement<T>`

    - #### set

          public void set(T[] aVal)

      Description copied from interface: `IConfigElement`
      [Property] Sets this property's value to the specified array.
      Specified by:
        `set` in interface `IConfigElement<T>`

    - #### getMinValue

          public T getMinValue()

      Description copied from interface: `IConfigElement`
      [Property] Gets this property's minimum value.
      Specified by:
        `getMinValue` in interface `IConfigElement<T>`

    - #### getMaxValue

          public T getMaxValue()

      Description copied from interface: `IConfigElement`
      [Property] Gets this property's maximum value.
      Specified by:
        `getMaxValue` in interface `IConfigElement<T>`