EntityBinding<E>
public class TupleTupleMarshalledBinding<E extends MarshalledTupleEntry & MarshalledTupleKeyEntity> extends TupleTupleBinding<E>
TupleTupleBinding
that delegates to the
MarshalledTupleEntry
and
MarshalledTupleKeyEntity
interfaces of the entity class.
This class calls the methods of the MarshalledTupleEntry
interface to convert between the data entry and entity object. It calls the
methods of the MarshalledTupleKeyEntity
interface to convert between
the key entry and the entity object. These two interfaces must both be
implemented by the entity class.
Constructor | Description |
---|---|
TupleTupleMarshalledBinding(java.lang.Class<E> cls) |
Creates a tuple-tuple marshalled binding object.
|
Modifier and Type | Method | Description |
---|---|---|
E |
entryToObject(TupleInput keyInput,
TupleInput dataInput) |
Constructs an entity object from
TupleInput key and data
entries. |
void |
objectToData(E object,
TupleOutput output) |
Extracts a key tuple from an entity object.
|
void |
objectToKey(E object,
TupleOutput output) |
Extracts a key tuple from an entity object.
|
entryToObject, objectToData, objectToKey
entryToInput, getTupleBufferSize, getTupleOutput, inputToEntry, newOutput, newOutput, outputToEntry, setTupleBufferSize
public TupleTupleMarshalledBinding(java.lang.Class<E> cls)
The given class is used to instantiate entity objects using Class.newInstance()
, and therefore must be a public class and have a
public no-arguments constructor. It must also implement the MarshalledTupleEntry
and MarshalledTupleKeyEntity
interfaces.
cls
- is the class of the entity objects.public E entryToObject(TupleInput keyInput, TupleInput dataInput)
TupleTupleBinding
TupleInput
key and data
entries.entryToObject
in class TupleTupleBinding<E extends MarshalledTupleEntry & MarshalledTupleKeyEntity>
keyInput
- is the TupleInput
key entry object.dataInput
- is the TupleInput
data entry object.public void objectToKey(E object, TupleOutput output)
TupleTupleBinding
objectToKey
in class TupleTupleBinding<E extends MarshalledTupleEntry & MarshalledTupleKeyEntity>
object
- is the entity object.output
- is the TupleOutput
to which the key should be
written.public void objectToData(E object, TupleOutput output)
TupleTupleBinding
objectToData
in class TupleTupleBinding<E extends MarshalledTupleEntry & MarshalledTupleKeyEntity>
object
- is the entity object.output
- is the TupleOutput
to which the data should be
written.Copyright (c) 1996, 2020 Oracle and/or its affiliates. All rights reserved.