Package org.bukkit.persistence
Class PersistentDataType.BooleanPersistentDataType
java.lang.Object
org.bukkit.persistence.PersistentDataType.BooleanPersistentDataType
- All Implemented Interfaces:
- PersistentDataType<Byte,- Boolean> 
- Enclosing interface:
- PersistentDataType<T,Z> 
public static class PersistentDataType.BooleanPersistentDataType
extends Object
implements PersistentDataType<Byte,Boolean> 
A convenience implementation to convert between Byte and Boolean as there is
 no native implementation for booleans. 
Any byte value not equal to 0 is considered to be true.
Any byte value not equal to 0 is considered to be true.
- 
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
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfromPrimitive(@NotNull Byte 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(@NotNull Boolean complex, @NotNull PersistentDataAdapterContext context) Returns the primitive data that resembles the complex object passed to this method.
- 
Constructor Details- 
BooleanPersistentDataTypepublic BooleanPersistentDataType()
 
- 
- 
Method Details- 
getPrimitiveTypeDescription copied from interface:PersistentDataTypeReturns the primitive data type of this tag.- Specified by:
- getPrimitiveTypein interface- PersistentDataType<Byte,- Boolean> 
- Returns:
- the class
 
- 
getComplexTypeDescription copied from interface:PersistentDataTypeReturns the complex object type the primitive value resembles.- Specified by:
- getComplexTypein interface- PersistentDataType<Byte,- Boolean> 
- Returns:
- the class type
 
- 
toPrimitive@NotNull public @NotNull Byte toPrimitive(@NotNull @NotNull Boolean 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<Byte,- Boolean> 
- Parameters:
- complex- the complex object instance
- context- the context this operation is running in
- Returns:
- the primitive value
 
- 
fromPrimitive@NotNull public @NotNull Boolean fromPrimitive(@NotNull @NotNull Byte primitive, @NotNull @NotNull PersistentDataAdapterContext context) Description copied from interface:PersistentDataTypeCreates a complex object based of the passed primitive value- Specified by:
- fromPrimitivein interface- PersistentDataType<Byte,- Boolean> 
- Parameters:
- primitive- the primitive value
- context- the context this operation is running in
- Returns:
- the complex object instance
 
 
-