Class IntegerDataField
java.lang.Object
com.palmergames.bukkit.towny.object.metadata.CustomDataField<Integer>
com.palmergames.bukkit.towny.object.metadata.IntegerDataField
- All Implemented Interfaces:
Cloneable
-
Field Summary
Fields inherited from class com.palmergames.bukkit.towny.object.metadata.CustomDataField
label
-
Constructor Summary
ConstructorDescriptionIntegerDataField
(String key) IntegerDataField
(String key, Integer value) IntegerDataField
(String key, Integer value, String label) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canParseFromString
(String str) Determines whether the given input can be parsed to the appropriate value.clone()
Formats and colors the value of the custom data field object.Gets the type id for the given CustomDataField class.void
setValueFromString
(String strValue) Sets the value based on the given input.static String
typeID()
Methods inherited from class com.palmergames.bukkit.towny.object.metadata.CustomDataField
equals, formatValueAsComp, getKey, getLabel, getLabelAsComp, getValue, hashCode, hasLabel, isValidType, serializeValueToString, setLabel, setValue, shouldDisplayInStatus, toString
-
Constructor Details
-
IntegerDataField
-
IntegerDataField
-
IntegerDataField
-
-
Method Details
-
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 classCustomDataField<Integer>
- Returns:
- type id of the given CustomDataField class.
-
typeID
-
setValueFromString
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 classCustomDataField<Integer>
- Parameters:
strValue
- input.
-
canParseFromString
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 classCustomDataField<Integer>
- Parameters:
str
- admin input- Returns:
- whether the string can be parsed or not
-
displayFormattedValue
Description copied from class:CustomDataField
Formats and colors the value of the custom data field object.- Specified by:
displayFormattedValue
in classCustomDataField<Integer>
- Returns:
- the formatted value of this data field.
-
clone
- Specified by:
clone
in classCustomDataField<Integer>
-