类 PersistentDataType.BooleanPersistentDataType
java.lang.Object
org.bukkit.persistence.PersistentDataType.BooleanPersistentDataType
- 所有已实现的接口:
PersistentDataType<Byte,Boolean>
- 封闭接口:
- PersistentDataType<P,
C>
public static class PersistentDataType.BooleanPersistentDataType
extends Object
implements PersistentDataType<Byte,Boolean>
一个便捷实现,用于在 Byte 和 Boolean 之间转换,因为布尔值没有原生实现。
任何不等于 0 的字节值都被视为 true。
任何不等于 0 的字节值都被视为 true。
-
嵌套类概要
从接口继承的嵌套类/接口 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(@NotNull Byte primitive, @NotNull PersistentDataAdapterContext context) 基于传递的原始值创建复杂对象。返回原始值所代表的复杂对象类型。返回此标签的原始数据类型。toPrimitive(@NotNull Boolean complex, @NotNull PersistentDataAdapterContext context) 返回与此方法传递的复杂对象相似的原始数据。
-
构造器详细资料
-
BooleanPersistentDataType
public BooleanPersistentDataType()
-
-
方法详细资料
-
getPrimitiveType
从接口复制的说明:PersistentDataType返回此标签的原始数据类型。原文: Returns the primitive data type of this tag.
- 指定者:
getPrimitiveType在接口中PersistentDataType<Byte,Boolean> - 返回:
- 类
-
getComplexType
从接口复制的说明:PersistentDataType返回原始值所代表的复杂对象类型。原文: Returns the complex object type the primitive value resembles.
- 指定者:
getComplexType在接口中PersistentDataType<Byte,Boolean> - 返回:
- 类类型
-
toPrimitive
@NotNull public @NotNull Byte toPrimitive(@NotNull @NotNull Boolean complex, @NotNull @NotNull PersistentDataAdapterContext context) 从接口复制的说明:PersistentDataType返回与此方法传递的复杂对象相似的原始数据。原文: Returns the primitive data that resembles the complex object passed to this method.
- 指定者:
toPrimitive在接口中PersistentDataType<Byte,Boolean> - 参数:
complex- 复杂对象实例context- 此操作运行的上下文- 返回:
- 原始值
-
fromPrimitive
@NotNull public @NotNull Boolean fromPrimitive(@NotNull @NotNull Byte primitive, @NotNull @NotNull PersistentDataAdapterContext context) 从接口复制的说明:PersistentDataType基于传递的原始值创建复杂对象。原文: Creates a complex object based of the passed primitive value
- 指定者:
fromPrimitive在接口中PersistentDataType<Byte,Boolean> - 参数:
primitive- 原始值context- 此操作运行的上下文- 返回:
- 复杂对象实例
-