T
- the generic type of the primitive objectsPersistentDataType<T,T>
public static class PersistentDataType.PrimitivePersistentDataType<T> extends Object implements PersistentDataType<T,T>
This implementation does not add any kind of logic, but is used to provide default implementations for the primitive types.
PersistentDataType.PrimitivePersistentDataType<T>
BYTE, BYTE_ARRAY, DOUBLE, FLOAT, INTEGER, INTEGER_ARRAY, LONG, LONG_ARRAY, SHORT, STRING, TAG_CONTAINER
Modifier and Type | Method | Description |
---|---|---|
T |
fromPrimitive(T primitive,
PersistentDataAdapterContext context) |
Creates a complex object based of the passed primitive value
|
Class<T> |
getComplexType() |
Returns the complex object type the primitive value resembles.
|
Class<T> |
getPrimitiveType() |
Returns the primitive data type of this tag.
|
T |
toPrimitive(T complex,
PersistentDataAdapterContext context) |
Returns the primitive data that resembles the complex object passed to
this method.
|
@NotNull public Class<T> getPrimitiveType()
PersistentDataType
getPrimitiveType
in interface PersistentDataType<T,T>
@NotNull public Class<T> getComplexType()
PersistentDataType
getComplexType
in interface PersistentDataType<T,T>
@NotNull public T toPrimitive(@NotNull T complex, @NotNull PersistentDataAdapterContext context)
PersistentDataType
toPrimitive
in interface PersistentDataType<T,T>
complex
- the complex object instancecontext
- the context this operation is running in@NotNull public T fromPrimitive(@NotNull T primitive, @NotNull PersistentDataAdapterContext context)
PersistentDataType
fromPrimitive
in interface PersistentDataType<T,T>
primitive
- the primitive valuecontext
- the context this operation is running inCopyright © 2019. All rights reserved.