org.terracotta.offheapstore.storage.portability
Class StringPortability

java.lang.Object
  extended by org.terracotta.offheapstore.storage.portability.StringPortability
All Implemented Interfaces:
Persistent, PersistentPortability<String>, Portability<String>

public class StringPortability
extends Object
implements PersistentPortability<String>


Field Summary
static StringPortability INSTANCE
           
 
Method Summary
 void bootstrap(ObjectInput input)
           
 void close()
           
 String decode(ByteBuffer buffer)
          Decodes a ByteBuffer to an object of type T.
 ByteBuffer encode(String object)
          Encodes an object of type T as a ByteBuffer.
 boolean equals(Object value, ByteBuffer readBuffer)
          Returns true if the encoded object once decoded would be Object.equals(Object) to the supplied object.
 void flush()
           
 void persist(ObjectOutput output)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final StringPortability INSTANCE
Method Detail

encode

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

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

decode

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

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

equals

public boolean equals(Object value,
                      ByteBuffer readBuffer)
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<String>
Parameters:
value - object to compare to
readBuffer - buffer containing encoded object
Returns:
true if the two parameters are "equal"

flush

public void flush()
           throws IOException
Specified by:
flush in interface Persistent
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Persistent
Throws:
IOException

persist

public void persist(ObjectOutput output)
             throws IOException
Specified by:
persist in interface Persistent
Throws:
IOException

bootstrap

public void bootstrap(ObjectInput input)
               throws IOException
Specified by:
bootstrap in interface Persistent
Throws:
IOException


Copyright © 2015. All Rights Reserved.