Package com.sleepycat.bind.tuple
Class TupleMarshalledBinding<E extends MarshalledTupleEntry>
java.lang.Object
com.sleepycat.bind.tuple.TupleBase<E>
com.sleepycat.bind.tuple.TupleBinding<E>
com.sleepycat.bind.tuple.TupleMarshalledBinding<E>
- All Implemented Interfaces:
EntryBinding<E>
A concrete
TupleBinding that delegates to the
MarshalledTupleEntry interface of the data or key object.
This class works by calling the methods of the MarshalledTupleEntry interface, which must be implemented by the key or
data class, to convert between the key or data entry and the object.
-
Constructor Summary
ConstructorsConstructorDescriptionTupleMarshalledBinding(Class<E> cls) Creates a tuple marshalled binding object. -
Method Summary
Modifier and TypeMethodDescriptionentryToObject(TupleInput input) Constructs a key or data object from aTupleInputentry.voidobjectToEntry(E object, TupleOutput output) Converts a key or data object to a tuple entry.Methods inherited from class com.sleepycat.bind.tuple.TupleBinding
entryToObject, getPrimitiveBinding, objectToEntryMethods inherited from class com.sleepycat.bind.tuple.TupleBase
entryToInput, getTupleBufferSize, getTupleOutput, inputToEntry, newOutput, newOutput, outputToEntry, setTupleBufferSize
-
Constructor Details
-
TupleMarshalledBinding
Creates a tuple marshalled binding object.The given class is used to instantiate key or data objects using
Class.newInstance(), and therefore must be a public class and have a public no-arguments constructor. It must also implement theMarshalledTupleEntryinterface.- Parameters:
cls- is the class of the key or data objects.
-
-
Method Details
-
entryToObject
Description copied from class:TupleBindingConstructs a key or data object from aTupleInputentry.- Specified by:
entryToObjectin classTupleBinding<E extends MarshalledTupleEntry>- Parameters:
input- is the tuple key or data entry.- Returns:
- the key or data object constructed from the entry.
-
objectToEntry
Description copied from class:TupleBindingConverts a key or data object to a tuple entry.- Specified by:
objectToEntryin classTupleBinding<E extends MarshalledTupleEntry>- Parameters:
object- is the key or data object.output- is the tuple entry to which the key or data should be written.
-