EntityBinding<E>
public abstract class SerialSerialBinding<K,D,E> extends java.lang.Object implements EntityBinding<E>
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.
Constructor | Description |
---|---|
SerialSerialBinding(ClassCatalog classCatalog,
java.lang.Class<K> keyClass,
java.lang.Class<D> dataClass) |
Creates a serial-serial entity binding.
|
SerialSerialBinding(SerialBinding<K> keyBinding,
SerialBinding<D> dataBinding) |
Creates a serial-serial entity binding.
|
Modifier and Type | Method | Description |
---|---|---|
E |
entryToObject(DatabaseEntry key,
DatabaseEntry data) |
Converts key and data entry buffers into an entity Object.
|
abstract E |
entryToObject(K keyInput,
D dataInput) |
Constructs an entity object from deserialized key and data objects.
|
abstract D |
objectToData(E object) |
Extracts a data object from an entity object.
|
void |
objectToData(E object,
DatabaseEntry data) |
Extracts the data entry from an entity Object.
|
abstract K |
objectToKey(E object) |
Extracts a key object from an entity object.
|
void |
objectToKey(E object,
DatabaseEntry key) |
Extracts the key entry from an entity Object.
|
public SerialSerialBinding(ClassCatalog classCatalog, java.lang.Class<K> keyClass, java.lang.Class<D> dataClass)
classCatalog
- is the catalog to hold shared class information and
for a database should be a StoredClassCatalog
.keyClass
- is the key base class.dataClass
- is the data base class.public SerialSerialBinding(SerialBinding<K> keyBinding, SerialBinding<D> dataBinding)
keyBinding
- is the key binding.dataBinding
- is the data binding.public E entryToObject(DatabaseEntry key, DatabaseEntry data)
EntityBinding
entryToObject
in interface EntityBinding<K>
key
- is the source key entry.data
- is the source data entry.public void objectToKey(E object, DatabaseEntry key)
EntityBinding
objectToKey
in interface EntityBinding<K>
object
- is the source Object.key
- is the destination entry buffer.public void objectToData(E object, DatabaseEntry data)
EntityBinding
objectToData
in interface EntityBinding<K>
object
- is the source Object.data
- is the destination entry buffer.public abstract E entryToObject(K keyInput, D dataInput)
keyInput
- is the deserialized key object.dataInput
- is the deserialized data object.public abstract K objectToKey(E object)
object
- is the entity object.Copyright (c) 1996, 2020 Oracle and/or its affiliates. All rights reserved.