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 Details

    • dataName

      protected String dataName
      The name of the data associated with the persistent data
    • dataValue

      protected Serializable dataValue
      The value of the data associated with the persistent data
  • Constructor Details

    • AbstractPersistentData

      public AbstractPersistentData(String dataName, Serializable dataValue)
      Initializes the PersistentData.
      Parameters:
      dataName - The name of the data.
      dataValue - The value of the data, must be serializable.
  • Method Details

    • changeDataValue

      public abstract AbstractPersistentData changeDataValue(Serializable newDataValue)
      Changes the value of the persistent data.
      Parameters:
      newDataValue - The new value of the data.
      Returns:
      The persistent data with the new value.
    • getData

      public abstract AbstractPersistentData getData()
      Gets the data.
      Returns:
      The data.
    • getDataValue

      public abstract Serializable getDataValue()
      Gets the value of the data.
      Returns:
      The value of the data.
    • getDataName

      public abstract String getDataName()
      Gets the name of the data.
      Returns:
      The name of the data.