Class PersistentData
java.lang.Object
me.thehandsomeyoni.persistentdataapi.AbstractPersistentData
me.thehandsomeyoni.persistentdataapi.data.PersistentData
- All Implemented Interfaces:
Serializable
,SerializablePersistentData<AbstractPersistentData>
A class that represents a persistent data.
- Since:
- 1.0
- Author:
- TheHandsomeYoni
- See Also:
-
Field Summary
Fields inherited from class me.thehandsomeyoni.persistentdataapi.AbstractPersistentData
dataName, dataValue
-
Constructor Summary
ConstructorsConstructorDescriptionPersistentData
(String dataName, Serializable dataValue) Initializes the PersistentData. -
Method Summary
Modifier and TypeMethodDescriptionchangeDataValue
(Serializable newDataValue) Changes the value of the data.static PersistentData
deserialize
(Map<String, Serializable> map) Deserializes data from mapgetData()
Gets the data.Gets the name of the data.Gets the value of the data.Serializes data to map, using the same way found in:ConfigurationSerializable
.
-
Constructor Details
-
PersistentData
Initializes the PersistentData.- Parameters:
dataName
- The name of the data.dataValue
- The value of the data.
-
-
Method Details
-
changeDataValue
Changes the value of the data.- Specified by:
changeDataValue
in classAbstractPersistentData
- Parameters:
newDataValue
- The new value of the data.- Returns:
- The new data with the new value.
-
getData
Gets the data.- Specified by:
getData
in classAbstractPersistentData
- Returns:
- The data.
-
getDataValue
Gets the value of the data.- Specified by:
getDataValue
in classAbstractPersistentData
- Returns:
- The value of the data.
-
getDataName
Gets the name of the data.- Specified by:
getDataName
in classAbstractPersistentData
- Returns:
- The name of the data.
-
serialize
Serializes data to map, using the same way found in:ConfigurationSerializable
.- Returns:
- A map with all the data.
-
deserialize
Deserializes data from map- Parameters:
map
- The map with all the data.- Returns:
- The deserialized data.
-