Class SingleVariablePersistentDataType

java.lang.Object
ch.njol.skript.util.SingleVariablePersistentDataType
All Implemented Interfaces:
org.bukkit.persistence.PersistentDataType<byte[],​SerializedVariable.Value>

public final class SingleVariablePersistentDataType extends Object implements org.bukkit.persistence.PersistentDataType<byte[],​SerializedVariable.Value>
This PersistentDataType is used for single variables. The NamespacedKey's key should be the variable's name. {hello} -> "hello" and the SerializedVariable.Value is the variable's serialized value.
See Also:
PersistentDataUtils.getNamespacedKey(String), PersistentDataUtils
  • Constructor Details

    • SingleVariablePersistentDataType

      public SingleVariablePersistentDataType()
  • Method Details

    • getPrimitiveType

      public Class<byte[]> getPrimitiveType()
      Specified by:
      getPrimitiveType in interface org.bukkit.persistence.PersistentDataType<byte[],​SerializedVariable.Value>
    • getComplexType

      public Class<SerializedVariable.Value> getComplexType()
      Specified by:
      getComplexType in interface org.bukkit.persistence.PersistentDataType<byte[],​SerializedVariable.Value>
    • toPrimitive

      public byte[] toPrimitive(SerializedVariable.Value complex, org.bukkit.persistence.PersistentDataAdapterContext context)
      Specified by:
      toPrimitive in interface org.bukkit.persistence.PersistentDataType<byte[],​SerializedVariable.Value>
    • fromPrimitive

      public SerializedVariable.Value fromPrimitive(byte[] primitive, org.bukkit.persistence.PersistentDataAdapterContext context)
      Specified by:
      fromPrimitive in interface org.bukkit.persistence.PersistentDataType<byte[],​SerializedVariable.Value>