Package org.bukkit.persistence
Class PersistentDataType.BooleanPersistentDataType
java.lang.Object
org.bukkit.persistence.PersistentDataType.BooleanPersistentDataType
- All Implemented Interfaces:
- PersistentDataType<Byte,- Boolean> 
- Enclosing interface:
- PersistentDataType<P,- C> 
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<P>
- 
Field SummaryFields inherited from interface org.bukkit.persistence.PersistentDataTypeBOOLEAN, BYTE, BYTE_ARRAY, DOUBLE, FLOAT, INTEGER, INTEGER_ARRAY, LIST, LONG, LONG_ARRAY, SHORT, STRING, TAG_CONTAINER, TAG_CONTAINER_ARRAY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfromPrimitive(Byte primitive, 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(Boolean complex, 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 Byte toPrimitive(@NotNull Boolean complex, @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 Boolean fromPrimitive(@NotNull Byte primitive, @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
 
 
-