public abstract class CustomStorableCodec<S extends Storable> extends java.lang.Object implements StorableCodec<S>
CustomStorableCodecFactory
Modifier and Type | Class and Description |
---|---|
static interface |
CustomStorableCodec.InstanceFactory |
Constructor and Description |
---|
CustomStorableCodec(java.lang.Class<S> type,
boolean isMaster) |
CustomStorableCodec(java.lang.Class<S> type,
boolean isMaster,
RawSupport<S> support) |
Modifier and Type | Method and Description |
---|---|
StorableIndex<S> |
buildPkIndex(java.lang.String... propertyNames)
Convenient way to define the clustered primary key index
descriptor.
|
abstract void |
decodeData(S storable,
byte[] bytes)
Decode the data into properties of the storable.
|
abstract void |
decodePrimaryKey(S storable,
byte[] bytes)
Decode the primary key into properties of the storable.
|
abstract byte[] |
encodeData(S storable)
Encode all properties of the storable excluding the primary key.
|
byte[] |
encodePrimaryKey(java.lang.Object[] values)
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.
|
java.util.Map<java.lang.String,? extends StorableProperty<S>> |
getAllProperties()
Convenient access to all the storable properties.
|
java.lang.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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decode, encodePrimaryKey, encodePrimaryKey, encodePrimaryKeyPrefix, getPrimaryKeyIndex, getPrimaryKeyPrefixLength, instantiate
public CustomStorableCodec(java.lang.Class<S> type, boolean isMaster) throws SupportException
isMaster
- when true, version properties and sequences are managedSupportException
- if Storable is not supportedpublic CustomStorableCodec(java.lang.Class<S> type, boolean isMaster, RawSupport<S> support) throws SupportException
isMaster
- when true, version properties and sequences are managedSupportException
- if Storable is not supportedpublic java.lang.Class<S> getStorableType()
StorableCodec
getStorableType
in interface StorableCodec<S extends Storable>
public S instantiate()
StorableCodec
RawSupport
is supplied to the instance.instantiate
in interface StorableCodec<S extends Storable>
public S instantiate(byte[] key, byte[] value) throws FetchException
StorableCodec
RawSupport
is supplied to the instance.instantiate
in interface StorableCodec<S extends Storable>
FetchException
public S instantiate(RawSupport<S> support)
StorableCodec
RawSupport
can be supplied to the instance.instantiate
in interface StorableCodec<S extends Storable>
support
- binds generated storable with a storage layerpublic S instantiate(RawSupport<S> support, byte[] key, byte[] value) throws FetchException
StorableCodec
RawSupport
can be supplied to the instance.instantiate
in interface StorableCodec<S extends Storable>
support
- binds generated storable with a storage layerFetchException
public byte[] encodePrimaryKey(S storable)
StorableCodec
encodePrimaryKey
in interface StorableCodec<S extends Storable>
storable
- extract primary key properties from this instancepublic byte[] encodePrimaryKey(java.lang.Object[] values)
StorableCodec
encodePrimaryKey
in interface StorableCodec<S extends Storable>
values
- values to build into a key. It must be long enough to
accommodate all primary key properties.public RawSupport<S> getSupport()
StorableCodec
RawSupport
object that is supplied to
Storable instances produced by this codec.getSupport
in interface StorableCodec<S extends Storable>
public java.util.Map<java.lang.String,? extends StorableProperty<S>> getAllProperties()
public StorableIndex<S> buildPkIndex(java.lang.String... propertyNames)
public abstract void decodePrimaryKey(S storable, byte[] bytes) throws CorruptEncodingException
CorruptEncodingException
public abstract byte[] encodeData(S storable)
public abstract void decodeData(S storable, byte[] bytes) throws CorruptEncodingException
CorruptEncodingException
Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.