org.terracotta.offheapstore.storage.portability
Class BooleanPortability

java.lang.Object
  extended by org.terracotta.offheapstore.storage.portability.BooleanPortability
All Implemented Interfaces:
Portability<Boolean>

public class BooleanPortability
extends Object
implements Portability<Boolean>


Field Summary
static BooleanPortability INSTANCE
           
 
Method Summary
 Boolean decode(ByteBuffer buffer)
          Decodes a ByteBuffer to an object of type T.
 ByteBuffer encode(Boolean object)
          Encodes an object of type T as a ByteBuffer.
 boolean equals(Object object, ByteBuffer buffer)
          Returns true if the encoded object once decoded would be Object.equals(Object) to the supplied object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final BooleanPortability INSTANCE
Method Detail

encode

public ByteBuffer encode(Boolean object)
Description copied from interface: Portability
Encodes an object of type T as a ByteBuffer.

Specified by:
encode in interface Portability<Boolean>
Parameters:
object - object to be encoded
Returns:
the encoded object

decode

public Boolean decode(ByteBuffer buffer)
Description copied from interface: Portability
Decodes a ByteBuffer to an object of type T.

Specified by:
decode in interface Portability<Boolean>
Parameters:
buffer - bytes to decode
Returns:
the decoded object

equals

public boolean equals(Object object,
                      ByteBuffer buffer)
Description copied from interface: Portability
Returns true if the encoded object once decoded would be Object.equals(Object) to the supplied object.

Specified by:
equals in interface Portability<Boolean>
Parameters:
object - object to compare to
buffer - buffer containing encoded object
Returns:
true if the two parameters are "equal"


Copyright © 2016. All rights reserved.