Class DecimalDataField

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

public class DecimalDataField extends CustomDataField<Double>
  • Constructor Details

    • DecimalDataField

      public DecimalDataField(String key, Double value)
    • DecimalDataField

      public DecimalDataField(String key, Double value, String label)
    • DecimalDataField

      public DecimalDataField(String key)
  • 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<Double>
      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<Double>
      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<Double>
      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<Double>
      Returns:
      the formatted value of this data field.
    • clone

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