Package com.sleepycat.bind.serial
Class SerialSerialBinding<K,D,E>
java.lang.Object
com.sleepycat.bind.serial.SerialSerialBinding<K,D,E>
- All Implemented Interfaces:
EntityBinding<E>
An abstract
EntityBinding that treats an entity's key entry and
data entry as serialized objects.
This class takes care of serializing and deserializing the key and data entry automatically. Its three abstract methods must be implemented by a concrete subclass to convert the deserialized objects to/from an entity object.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSerialSerialBinding(ClassCatalog classCatalog, Class<K> keyClass, Class<D> dataClass) Creates a serial-serial entity binding.SerialSerialBinding(SerialBinding<K> keyBinding, SerialBinding<D> dataBinding) Creates a serial-serial entity binding. -
Method Summary
Modifier and TypeMethodDescriptionentryToObject(DatabaseEntry key, DatabaseEntry data) Converts key and data entry buffers into an entity Object.abstract EentryToObject(K keyInput, D dataInput) Constructs an entity object from deserialized key and data objects.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 KobjectToKey(E object) Extracts a key object from an entity object.voidobjectToKey(E object, DatabaseEntry key) Extracts the key entry from an entity Object.
-
Constructor Details
-
SerialSerialBinding
Creates a serial-serial entity binding.- Parameters:
classCatalog- is the catalog to hold shared class information and for a database should be aStoredClassCatalog.keyClass- is the key base class.dataClass- is the data base class.
-
SerialSerialBinding
Creates a serial-serial entity binding.- Parameters:
keyBinding- is the key binding.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<K>- 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<K>- 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<K>- Parameters:
object- is the source Object.data- is the destination entry buffer.
-
entryToObject
Constructs an entity object from deserialized key and data objects.- Parameters:
keyInput- is the deserialized key object.dataInput- is the deserialized data object.- Returns:
- the entity object constructed from the key and data.
-
objectToKey
Extracts a key object from an entity object.- Parameters:
object- is the entity object.- Returns:
- the deserialized key object.
-
objectToData
Extracts a data object from an entity object.- Parameters:
object- is the entity object.- Returns:
- the deserialized data object.
-