Class StringPortability
- java.lang.Object
-
- org.terracotta.offheapstore.storage.portability.StringPortability
-
- All Implemented Interfaces:
Persistent,PersistentPortability<java.lang.String>,Portability<java.lang.String>
public class StringPortability extends java.lang.Object implements PersistentPortability<java.lang.String>
-
-
Field Summary
Fields Modifier and Type Field Description static StringPortabilityINSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description privateStringPortability()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbootstrap(java.io.ObjectInput input)voidclose()java.lang.Stringdecode(java.nio.ByteBuffer buffer)Decodes aByteBufferto an object of typeT.java.nio.ByteBufferencode(java.lang.String object)Encodes an object of typeTas aByteBuffer.booleanequals(java.lang.Object value, java.nio.ByteBuffer readBuffer)Returns true if the encoded object once decoded would beObject.equals(Object)to the supplied object.voidflush()voidpersist(java.io.ObjectOutput output)
-
-
-
Field Detail
-
INSTANCE
public static final StringPortability INSTANCE
-
-
Method Detail
-
encode
public java.nio.ByteBuffer encode(java.lang.String object)
Description copied from interface:PortabilityEncodes an object of typeTas aByteBuffer.- Specified by:
encodein interfacePortability<java.lang.String>- Parameters:
object- object to be encoded- Returns:
- the encoded object
-
decode
public java.lang.String decode(java.nio.ByteBuffer buffer)
Description copied from interface:PortabilityDecodes aByteBufferto an object of typeT.- Specified by:
decodein interfacePortability<java.lang.String>- Parameters:
buffer- bytes to decode- Returns:
- the decoded object
-
equals
public boolean equals(java.lang.Object value, java.nio.ByteBuffer readBuffer)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.String>- Parameters:
value- object to compare toreadBuffer- buffer containing encoded object- Returns:
trueif the two parameters are "equal"
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacePersistent- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacePersistent- Throws:
java.io.IOException
-
persist
public void persist(java.io.ObjectOutput output) throws java.io.IOException- Specified by:
persistin interfacePersistent- Throws:
java.io.IOException
-
bootstrap
public void bootstrap(java.io.ObjectInput input) throws java.io.IOException- Specified by:
bootstrapin interfacePersistent- Throws:
java.io.IOException
-
-