Class BooleanPortability
- java.lang.Object
-
- org.terracotta.offheapstore.storage.portability.BooleanPortability
-
- All Implemented Interfaces:
Portability<java.lang.Boolean>
public class BooleanPortability extends java.lang.Object implements Portability<java.lang.Boolean>
-
-
Field Summary
Fields Modifier and Type Field Description private static java.nio.ByteBufferFALSEstatic BooleanPortabilityINSTANCEprivate static java.nio.ByteBufferTRUE
-
Constructor Summary
Constructors Modifier Constructor Description privateBooleanPortability()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Booleandecode(java.nio.ByteBuffer buffer)Decodes aByteBufferto an object of typeT.java.nio.ByteBufferencode(java.lang.Boolean object)Encodes an object of typeTas aByteBuffer.booleanequals(java.lang.Object object, java.nio.ByteBuffer buffer)Returns true if the encoded object once decoded would beObject.equals(Object)to the supplied object.
-
-
-
Field Detail
-
INSTANCE
public static final BooleanPortability INSTANCE
-
TRUE
private static final java.nio.ByteBuffer TRUE
-
FALSE
private static final java.nio.ByteBuffer FALSE
-
-
Method Detail
-
encode
public java.nio.ByteBuffer encode(java.lang.Boolean object)
Description copied from interface:PortabilityEncodes an object of typeTas aByteBuffer.- Specified by:
encodein interfacePortability<java.lang.Boolean>- Parameters:
object- object to be encoded- Returns:
- the encoded object
-
decode
public java.lang.Boolean decode(java.nio.ByteBuffer buffer)
Description copied from interface:PortabilityDecodes aByteBufferto an object of typeT.- Specified by:
decodein interfacePortability<java.lang.Boolean>- Parameters:
buffer- bytes to decode- Returns:
- the decoded object
-
equals
public boolean equals(java.lang.Object object, java.nio.ByteBuffer buffer)Description copied from interface:PortabilityReturns true if the encoded object once decoded would beObject.equals(Object)to the supplied object.- Specified by:
equalsin interfacePortability<java.lang.Boolean>- Parameters:
object- object to compare tobuffer- buffer containing encoded object- Returns:
trueif the two parameters are "equal"
-
-