com.amazon.carbonado.raw
Interface GenericStorableCodec.SearchKeyFactory<S extends Storable>

Enclosing class:
GenericStorableCodec<S extends Storable>

public static interface GenericStorableCodec.SearchKeyFactory<S extends Storable>

Creates custom raw search keys for Storable types. It is intended for supporting queries and indexes.


Method Summary
 byte[] encodeSearchKey(Object[] values)
          Build a search key by supplying property values without a storable.
 byte[] encodeSearchKey(Object[] values, int rangeStart, int rangeEnd)
          Build a search key by supplying property values without a storable.
 byte[] encodeSearchKey(S storable)
          Build a search key by extracting all the desired properties from the given storable.
 byte[] encodeSearchKey(S storable, int rangeStart, int rangeEnd)
          Build a search key by extracting all the desired properties from the given storable.
 byte[] encodeSearchKeyPrefix()
          Returns the search key for when there are no values.
 

Method Detail

encodeSearchKey

byte[] encodeSearchKey(S storable)
Build a search key by extracting all the desired properties from the given storable.

Parameters:
storable - extract a subset of properties from this instance
Returns:
raw search key

encodeSearchKey

byte[] encodeSearchKey(S storable,
                       int rangeStart,
                       int rangeEnd)
Build a search key by extracting all the desired properties from the given storable.

Parameters:
storable - extract a subset of properties from this instance
rangeStart - index of first property to use. Its value must be less than the count of properties used by this factory.
rangeEnd - index of last property to use, exlusive. Its value must be less than or equal to the count of properties used by this factory.
Returns:
raw search key

encodeSearchKey

byte[] encodeSearchKey(Object[] values)
Build a search key by supplying property values without a storable.

Parameters:
values - values to build into a key. It must be long enough to accommodate all of properties used by this factory.
Returns:
raw search key

encodeSearchKey

byte[] encodeSearchKey(Object[] values,
                       int rangeStart,
                       int rangeEnd)
Build a search key by supplying property values without a storable.

Parameters:
values - values to build into a key. The length may be less than the amount of 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 properties used by this factory.
rangeEnd - index of last property to use, exlusive. Its value must be less than or equal to the count of properties used by this factory.
Returns:
raw search key

encodeSearchKeyPrefix

byte[] encodeSearchKeyPrefix()
Returns the search key for when there are no values. Returned value may be null.



Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.