Interface Portability<T>
- Type Parameters:
T- type handled by this converter
- All Known Subinterfaces:
PersistentPortability<T>, WriteBackPortability<T>
- All Known Implementing Classes:
BooleanPortability, ByteArrayPortability, PersistentByteArrayPortability, PersistentSerializablePortability, SerializablePortability, StringPortability
public interface Portability<T>
An object to ByteBuffer converter.
-
Method Summary
Modifier and TypeMethodDescriptiondecode(ByteBuffer buffer) Decodes aByteBufferto an object of typeT.Encodes an object of typeTas aByteBuffer.booleanequals(Object object, ByteBuffer buffer) Returns true if the encoded object once decoded would beObject.equals(Object)to the supplied object.
-
Method Details
-
encode
Encodes an object of typeTas aByteBuffer.- Parameters:
object- object to be encoded- Returns:
- the encoded object
-
decode
Decodes aByteBufferto an object of typeT.- Parameters:
buffer- bytes to decode- Returns:
- the decoded object
-
equals
Returns true if the encoded object once decoded would beObject.equals(Object)to the supplied object.- Parameters:
object- object to compare tobuffer- buffer containing encoded object- Returns:
trueif the two parameters are "equal"
-