|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface StorableCodec<S extends Storable>
Supports encoding and decoding of storables.
StorableCodecFactory| Method Summary | |
|---|---|
void |
decode(S dest,
int generation,
byte[] data)
Used for decoding different generations of Storable. |
byte[] |
encodePrimaryKey(Object[] values)
Encode a key by extracting all the primary key properties from the given storable. |
byte[] |
encodePrimaryKey(Object[] values,
int rangeStart,
int rangeEnd)
Encode a key by extracting all the primary key properties from the given storable. |
byte[] |
encodePrimaryKey(S storable)
Encode a key by extracting all the primary key properties from the given storable. |
byte[] |
encodePrimaryKey(S storable,
int rangeStart,
int rangeEnd)
Encode a key by extracting all the primary key properties from the given storable. |
byte[] |
encodePrimaryKeyPrefix()
Encode the primary key for when there are no values, but there may be a prefix. |
StorableIndex<S> |
getPrimaryKeyIndex()
Returns the sequence and directions of properties that make up the primary key. |
int |
getPrimaryKeyPrefixLength()
Returns the number of prefix bytes in the primary key, which may be zero. |
Class<S> |
getStorableType()
Returns the type of Storable produced by this codec. |
RawSupport<S> |
getSupport()
Returns the default RawSupport object that is supplied to
Storable instances produced by this codec. |
S |
instantiate()
Instantiate a Storable with no key or value defined yet. |
S |
instantiate(byte[] key,
byte[] value)
Instantiate a Storable with a specific key and value. |
S |
instantiate(RawSupport<S> support)
Instantiate a Storable with no key or value defined yet. |
S |
instantiate(RawSupport<S> support,
byte[] key,
byte[] value)
Instantiate a Storable with a specific key and value. |
| Method Detail |
|---|
Class<S> getStorableType()
S instantiate()
RawSupport is supplied to the instance.
IllegalStateException - if no default support exists
S instantiate(byte[] key,
byte[] value)
throws FetchException
RawSupport is supplied to the instance.
IllegalStateException - if no default support exists
FetchExceptionS instantiate(RawSupport<S> support)
RawSupport can be supplied to the instance.
support - binds generated storable with a storage layer
S instantiate(RawSupport<S> support,
byte[] key,
byte[] value)
throws FetchException
RawSupport can be supplied to the instance.
support - binds generated storable with a storage layer
FetchExceptionStorableIndex<S> getPrimaryKeyIndex()
int getPrimaryKeyPrefixLength()
byte[] encodePrimaryKey(S storable)
storable - extract primary key properties from this instance
byte[] encodePrimaryKey(S storable,
int rangeStart,
int rangeEnd)
storable - extract primary key properties from this instancerangeStart - index of first property to use. Its value must be less
than the count of primary key properties.rangeEnd - index of last property to use, exlusive. Its value must
be less than or equal to the count of primary key properties.
byte[] encodePrimaryKey(Object[] values)
values - values to build into a key. It must be long enough to
accommodate all primary key properties.
byte[] encodePrimaryKey(Object[] values,
int rangeStart,
int rangeEnd)
values - values to build into a key. The length may be less than
the amount of primary key properties used by this factory. It must not
be less than the difference between rangeStart and rangeEnd.rangeStart - index of first property to use. Its value must be less
than the count of primary key properties.rangeEnd - index of last property to use, exlusive. Its value must
be less than or equal to the count of primary key properties.
byte[] encodePrimaryKeyPrefix()
void decode(S dest,
int generation,
byte[] data)
throws CorruptEncodingException
dest - storable to receive decoded propertiesgeneration - storable layout generation numberdata - decoded into properties, some of which may be dropped if
destination storable doesn't have it
CorruptEncodingException - if generation is unknown or if data cannot be decodedRawSupport<S> getSupport()
RawSupport object that is supplied to
Storable instances produced by this codec.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||