com.sleepycat.bind.tuple

Class TupleTupleBinding

public abstract class TupleTupleBinding extends TupleBase implements EntityBinding

An abstract EntityBinding that treats an entity's key entry and data entry as tuples.

This class takes care of converting the entries to/from TupleInput and TupleOutput objects. Its three abstract methods must be implemented by a concrete subclass to convert between tuples and entity objects.

Constructor Summary
TupleTupleBinding()
Creates a tuple-tuple entity binding.
Method Summary
ObjectentryToObject(DatabaseEntry key, DatabaseEntry data)
abstract ObjectentryToObject(TupleInput keyInput, TupleInput dataInput)
Constructs an entity object from TupleInput key and data entries.
voidobjectToData(Object object, DatabaseEntry data)
abstract voidobjectToData(Object object, TupleOutput output)
Extracts a key tuple from an entity object.
voidobjectToKey(Object object, DatabaseEntry key)
abstract voidobjectToKey(Object object, TupleOutput output)
Extracts a key tuple from an entity object.

Constructor Detail

TupleTupleBinding

public TupleTupleBinding()
Creates a tuple-tuple entity binding.

Method Detail

entryToObject

public Object entryToObject(DatabaseEntry key, DatabaseEntry data)

entryToObject

public abstract Object entryToObject(TupleInput keyInput, TupleInput dataInput)
Constructs an entity object from TupleInput key and data entries.

Parameters: keyInput is the TupleInput key entry object. dataInput is the TupleInput data entry object.

Returns: the entity object constructed from the key and data.

objectToData

public void objectToData(Object object, DatabaseEntry data)

objectToData

public abstract void objectToData(Object object, TupleOutput output)
Extracts a key tuple from an entity object.

Parameters: object is the entity object. output is the TupleOutput to which the data should be written.

objectToKey

public void objectToKey(Object object, DatabaseEntry key)

objectToKey

public abstract void objectToKey(Object object, TupleOutput output)
Extracts a key tuple from an entity object.

Parameters: object is the entity object. output is the TupleOutput to which the key should be written.