类 PersistentDataType.PrimitivePersistentDataType<P>
java.lang.Object
org.bukkit.persistence.PersistentDataType.PrimitivePersistentDataType<P>
- 类型参数:
P
- the generic type of the primitive objects
- 所有已实现的接口:
PersistentDataType<P,
P>
- 封闭接口:
- PersistentDataType<P,
C>
public static class PersistentDataType.PrimitivePersistentDataType<P>
extends Object
implements PersistentDataType<P,P>
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.
-
嵌套类概要
从接口继承的嵌套类/接口 org.bukkit.persistence.PersistentDataType
PersistentDataType.BooleanPersistentDataType, PersistentDataType.PrimitivePersistentDataType<P>
-
字段概要
从接口继承的字段 org.bukkit.persistence.PersistentDataType
BOOLEAN, BYTE, BYTE_ARRAY, DOUBLE, FLOAT, INTEGER, INTEGER_ARRAY, LIST, LONG, LONG_ARRAY, SHORT, STRING, TAG_CONTAINER, TAG_CONTAINER_ARRAY
-
方法概要
修饰符和类型方法说明fromPrimitive
(P 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
(P complex, @NotNull PersistentDataAdapterContext context) Returns the primitive data that resembles the complex object passed to this method.
-
方法详细资料
-
getPrimitiveType
从接口复制的说明:PersistentDataType
Returns the primitive data type of this tag.- 指定者:
getPrimitiveType
在接口中PersistentDataType<P,
P> - 返回:
- the class
-
getComplexType
从接口复制的说明:PersistentDataType
Returns the complex object type the primitive value resembles.- 指定者:
getComplexType
在接口中PersistentDataType<P,
P> - 返回:
- the class type
-
toPrimitive
@NotNull public P toPrimitive(@NotNull P complex, @NotNull @NotNull PersistentDataAdapterContext context) 从接口复制的说明:PersistentDataType
Returns the primitive data that resembles the complex object passed to this method.- 指定者:
toPrimitive
在接口中PersistentDataType<P,
P> - 参数:
complex
- the complex object instancecontext
- the context this operation is running in- 返回:
- the primitive value
-
fromPrimitive
@NotNull public P fromPrimitive(@NotNull P primitive, @NotNull @NotNull PersistentDataAdapterContext context) 从接口复制的说明:PersistentDataType
Creates a complex object based of the passed primitive value- 指定者:
fromPrimitive
在接口中PersistentDataType<P,
P> - 参数:
primitive
- the primitive valuecontext
- the context this operation is running in- 返回:
- the complex object instance
-