Package org.bukkit.persistence
Class PersistentDataType.PrimitivePersistentDataType<T>
java.lang.Object
org.bukkit.persistence.PersistentDataType.PrimitivePersistentDataType<T>
- Type Parameters:
- T- the generic type of the primitive objects
- All Implemented Interfaces:
- PersistentDataType<T,- T> 
- Enclosing interface:
- PersistentDataType<T,Z> 
public static class PersistentDataType.PrimitivePersistentDataType<T>
extends Object
implements PersistentDataType<T,T> 
A default implementation that simply exists to pass on the retrieved or
 inserted value to the next layer.
 
This implementation does not add any kind of logic, but is used to provide default implementations for the primitive types.
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.bukkit.persistence.PersistentDataTypePersistentDataType.BooleanPersistentDataType, PersistentDataType.PrimitivePersistentDataType<T>
- 
Field SummaryFields inherited from interface org.bukkit.persistence.PersistentDataTypeBOOLEAN, BYTE, BYTE_ARRAY, DOUBLE, FLOAT, INTEGER, INTEGER_ARRAY, LONG, LONG_ARRAY, SHORT, STRING, TAG_CONTAINER, TAG_CONTAINER_ARRAY
- 
Method SummaryModifier and TypeMethodDescriptionfromPrimitive(T primitive, @NotNull PersistentDataAdapterContext context) Creates a complex object based of the passed primitive valueReturns the complex object type the primitive value resembles.Returns the primitive data type of this tag.toPrimitive(T complex, @NotNull PersistentDataAdapterContext context) Returns the primitive data that resembles the complex object passed to this method.
- 
Method Details- 
getPrimitiveTypeDescription copied from interface:PersistentDataTypeReturns the primitive data type of this tag.- Specified by:
- getPrimitiveTypein interface- PersistentDataType<T,- T> 
- Returns:
- the class
 
- 
getComplexTypeDescription copied from interface:PersistentDataTypeReturns the complex object type the primitive value resembles.- Specified by:
- getComplexTypein interface- PersistentDataType<T,- T> 
- Returns:
- the class type
 
- 
toPrimitive@NotNull public T toPrimitive(@NotNull T complex, @NotNull @NotNull PersistentDataAdapterContext context) Description copied from interface:PersistentDataTypeReturns the primitive data that resembles the complex object passed to this method.- Specified by:
- toPrimitivein interface- PersistentDataType<T,- T> 
- Parameters:
- complex- the complex object instance
- context- the context this operation is running in
- Returns:
- the primitive value
 
- 
fromPrimitive@NotNull public T fromPrimitive(@NotNull T primitive, @NotNull @NotNull PersistentDataAdapterContext context) Description copied from interface:PersistentDataTypeCreates a complex object based of the passed primitive value- Specified by:
- fromPrimitivein interface- PersistentDataType<T,- T> 
- Parameters:
- primitive- the primitive value
- context- the context this operation is running in
- Returns:
- the complex object instance
 
 
-