com.basho.riak.client.convert.reflect
Class AnnotationInfo

java.lang.Object
  extended by com.basho.riak.client.convert.reflect.AnnotationInfo

public class AnnotationInfo
extends Object

Class that contains the Riak annotated fields for an annotated class

Author:
russell

Constructor Summary
AnnotationInfo(Field riakKeyField, List<UsermetaField> usermetaItemFields, Field usermetaMapField, List<RiakIndexField> indexFields, Field riakLinksField)
           
 
Method Summary
<T> RiakIndexes
getIndexes(T obj)
           
<T> Collection<RiakLink>
getLinks(T obj)
           
<T> String
getRiakKey(T obj)
           
<T> Map<String,String>
getUsermetaData(T obj)
           
 boolean hasRiakKey()
           
<T> void
setIndexes(RiakIndexes indexes, T obj)
          TODO handle multi-value indexes with the same name
<T> void
setLinks(Collection<RiakLink> links, T obj)
           
<T> void
setRiakKey(T obj, String key)
           
<T> void
setUsermetaData(Map<String,String> usermetaData, T obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationInfo

public AnnotationInfo(Field riakKeyField,
                      List<UsermetaField> usermetaItemFields,
                      Field usermetaMapField,
                      List<RiakIndexField> indexFields,
                      Field riakLinksField)
Parameters:
riakKeyField -
usermetaItemFields -
usermetaMapField -
Method Detail

hasRiakKey

public boolean hasRiakKey()
Returns:

getRiakKey

public <T> String getRiakKey(T obj)
Type Parameters:
T -
Parameters:
obj -
Returns:

setRiakKey

public <T> void setRiakKey(T obj,
                           String key)

getUsermetaData

public <T> Map<String,String> getUsermetaData(T obj)

setUsermetaData

public <T> void setUsermetaData(Map<String,String> usermetaData,
                                T obj)

getIndexes

public <T> RiakIndexes getIndexes(T obj)
Returns:
a RiakIndexes made of the values of the RiakIndex annotated fields

setIndexes

public <T> void setIndexes(RiakIndexes indexes,
                           T obj)
TODO handle multi-value indexes with the same name

Type Parameters:
T -
Parameters:
indexes - the RiakIndexes to copy to the domain object
obj - the domain object to set indexes on

getLinks

public <T> Collection<RiakLink> getLinks(T obj)

setLinks

public <T> void setLinks(Collection<RiakLink> links,
                         T obj)


Copyright © 2012. All Rights Reserved.