Class AbstractPersistentData
java.lang.Object
me.thehandsomeyoni.persistentdataapi.AbstractPersistentData
- All Implemented Interfaces:
Serializable
,SerializablePersistentData<AbstractPersistentData>
- Direct Known Subclasses:
PersistentData
public abstract class AbstractPersistentData
extends Object
implements SerializablePersistentData<AbstractPersistentData>
A class that represents a persistent data.
- Since:
- 1.0
- Author:
- TheHandsomeYoni
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
The name of the data associated with the persistent dataprotected Serializable
The value of the data associated with the persistent data -
Constructor Summary
ConstructorsConstructorDescriptionAbstractPersistentData
(String dataName, Serializable dataValue) Initializes the PersistentData. -
Method Summary
Modifier and TypeMethodDescriptionabstract AbstractPersistentData
changeDataValue
(Serializable newDataValue) Changes the value of the persistent data.abstract AbstractPersistentData
getData()
Gets the data.abstract String
Gets the name of the data.abstract Serializable
Gets the value of the data.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface me.thehandsomeyoni.persistentdataapi.data.SerializablePersistentData
serialize
-
Field Details
-
dataName
The name of the data associated with the persistent data -
dataValue
The value of the data associated with the persistent data
-
-
Constructor Details
-
AbstractPersistentData
Initializes the PersistentData.- Parameters:
dataName
- The name of the data.dataValue
- The value of the data, must be serializable.
-
-
Method Details
-
changeDataValue
Changes the value of the persistent data.- Parameters:
newDataValue
- The new value of the data.- Returns:
- The persistent data with the new value.
-
getData
Gets the data.- Returns:
- The data.
-
getDataValue
Gets the value of the data.- Returns:
- The value of the data.
-
getDataName
Gets the name of the data.- Returns:
- The name of the data.
-