Class IntegerDataField

java.lang.Object
com.palmergames.bukkit.towny.object.metadata.CustomDataField<Integer>
com.palmergames.bukkit.towny.object.metadata.IntegerDataField
All Implemented Interfaces:
Cloneable

public class IntegerDataField extends CustomDataField<Integer>
  • Constructor Details

    • IntegerDataField

      public IntegerDataField(String key)
    • IntegerDataField

      public IntegerDataField(String key, Integer value, String label)
    • IntegerDataField

      public IntegerDataField(String key, Integer value)
  • Method Details

    • getTypeID

      public String getTypeID()
      Description copied from class: CustomDataField
      Gets the type id for the given CustomDataField class. This value is attached to the class, and not a specific instance. Used for serialization purposes.
      Specified by:
      getTypeID in class CustomDataField<Integer>
      Returns:
      type id of the given CustomDataField class.
    • typeID

      public static String typeID()
    • setValueFromString

      public void setValueFromString(String strValue)
      Description copied from class: CustomDataField
      Sets the value based on the given input. Used when admins want to edit metadata in-game.
      Specified by:
      setValueFromString in class CustomDataField<Integer>
      Parameters:
      strValue - input.
    • canParseFromString

      public boolean canParseFromString(String str)
      Description copied from class: CustomDataField
      Determines whether the given input can be parsed to the appropriate value. Used to parse admin input for in-game metadata editing.
      Overrides:
      canParseFromString in class CustomDataField<Integer>
      Parameters:
      str - admin input
      Returns:
      whether the string can be parsed or not
    • displayFormattedValue

      public String displayFormattedValue()
      Description copied from class: CustomDataField
      Formats and colors the value of the custom data field object.
      Specified by:
      displayFormattedValue in class CustomDataField<Integer>
      Returns:
      the formatted value of this data field.
    • clone

      public CustomDataField<Integer> clone()
      Specified by:
      clone in class CustomDataField<Integer>