T - The deserializable type for the value of this KV object.public class KvObject<T> extends java.lang.Object implements KvMetadata
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCollection()
Returns the collection this metadata belongs to.
|
java.lang.String |
getKey()
Returns the key of this metadata.
|
java.lang.String |
getRawValue()
Returns the raw JSON value of this KV object.
|
java.lang.String |
getRef()
Returns the reference (i.e.
|
T |
getValue()
Returns the value of this KV object.
|
<T> T |
getValue(java.lang.Class<T> clazz)
Returns the value of this KV object, mapped to the provided Class.
|
public final T getValue()
null.public <T> T getValue(java.lang.Class<T> clazz)
To get the value as the raw json, call with String.class
String json = kv.getValue(String.class);This is equivalent to calling getRawValue. Other common use cases are Map.class (to just get the json as a nested hashmap), or a POJO class of your own (for example a simple User java bean class).
null.public final java.lang.String getRawValue()
null.public java.lang.String getCollection()
KvMetadatagetCollection in interface KvMetadatapublic java.lang.String getKey()
KvMetadatagetKey in interface KvMetadatapublic java.lang.String getRef()
KvMetadatagetRef in interface KvMetadata