Package com.sleepycat.bind.serial
Class TupleSerialBinding<D,E>
java.lang.Object
com.sleepycat.bind.tuple.TupleBase
com.sleepycat.bind.serial.TupleSerialBinding<D,E>
- All Implemented Interfaces:
EntityBinding<E>
- Direct Known Subclasses:
TupleSerialMarshalledBinding
An abstract
EntityBinding that treats an entity's key entry as
a tuple and its data entry as a serialized object.
This class takes care of serializing and deserializing the data entry,
and converting the key entry to/from TupleInput and TupleOutput objects. Its three abstract methods must be implemented by a
concrete subclass to convert these objects to/from an entity object.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTupleSerialBinding(ClassCatalog classCatalog, Class<D> baseClass) Creates a tuple-serial entity binding.TupleSerialBinding(SerialBinding<D> dataBinding) Creates a tuple-serial entity binding. -
Method Summary
Modifier and TypeMethodDescriptionabstract EentryToObject(TupleInput keyInput, D dataInput) Constructs an entity object fromTupleInputkey entry and deserialized data entry objects.entryToObject(DatabaseEntry key, DatabaseEntry data) Converts key and data entry buffers into an entity Object.abstract DobjectToData(E object) Extracts a data object from an entity object.voidobjectToData(E object, DatabaseEntry data) Extracts the data entry from an entity Object.abstract voidobjectToKey(E object, TupleOutput keyOutput) Extracts a key tuple from an entity object.voidobjectToKey(E object, DatabaseEntry key) Extracts the key entry from an entity Object.Methods inherited from class com.sleepycat.bind.tuple.TupleBase
entryToInput, getTupleBufferSize, getTupleOutput, inputToEntry, newOutput, newOutput, outputToEntry, setTupleBufferSize
-
Field Details
-
dataBinding
-
-
Constructor Details
-
TupleSerialBinding
Creates a tuple-serial entity binding.- Parameters:
classCatalog- is the catalog to hold shared class information and for a database should be aStoredClassCatalog.baseClass- is the base class.
-
TupleSerialBinding
Creates a tuple-serial entity binding.- Parameters:
dataBinding- is the data binding.
-
-
Method Details
-
entryToObject
Description copied from interface:EntityBindingConverts key and data entry buffers into an entity Object.- Specified by:
entryToObjectin interfaceEntityBinding<D>- Parameters:
key- is the source key entry.data- is the source data entry.- Returns:
- the resulting Object.
-
objectToKey
Description copied from interface:EntityBindingExtracts the key entry from an entity Object.- Specified by:
objectToKeyin interfaceEntityBinding<D>- Parameters:
object- is the source Object.key- is the destination entry buffer.
-
objectToData
Description copied from interface:EntityBindingExtracts the data entry from an entity Object.- Specified by:
objectToDatain interfaceEntityBinding<D>- Parameters:
object- is the source Object.data- is the destination entry buffer.
-
entryToObject
Constructs an entity object fromTupleInputkey entry and deserialized data entry objects.- Parameters:
keyInput- is theTupleInputkey entry object.dataInput- is the deserialized data entry object.- Returns:
- the entity object constructed from the key and data.
-
objectToKey
Extracts a key tuple from an entity object.- Parameters:
object- is the entity object.keyOutput- is theTupleOutputto which the key should be written.
-
objectToData
Extracts a data object from an entity object.- Parameters:
object- is the entity object.- Returns:
- the deserialized data object.
-