public class KeyUtil extends Object
RiakKey,
JSONConverter| Constructor and Description |
|---|
KeyUtil() |
| Modifier and Type | Method and Description |
|---|---|
static <T> String |
getKey(T domainObject)
Attempts to get a key from
domainObject by looking for a
RiakKey annotated field. |
static <T> String |
getKey(T domainObject,
String defaultKey)
Attempts to get a key from
domainObject by looking for a
RiakKey annotated field. |
static <T> T |
setKey(T domainObject,
String key)
|
public static <T> T setKey(T domainObject,
String key)
throws ConversionException
T - the type of domainObjectdomainObject - the object to inject the key intokey - the key to injectdomainObject with RiakKey annotated field
set to keyConversionException - if there is a RiakKey annotated field but it cannot
be set to the value of keypublic static <T> String getKey(T domainObject, String defaultKey)
domainObject by looking for a
RiakKey annotated field. If non-present it simply returns
defaultKeyT - the type of domainObjectdomainObject - the object to search for a keydefaultKey - the pass through value that will get returned if no key found
on domainObjectdomainObject;s
RiakKey field or defaultkeypublic static <T> String getKey(T domainObject)
domainObject by looking for a
RiakKey annotated field. If non-present it simply returns
nullT - the type of domainObjectdomainObject - the object to search for a keydomainObject;s
RiakKey field or nullCopyright © 2014. All Rights Reserved.