public static class UpdateValue.Response extends Object
Modifier and Type | Method and Description |
---|---|
int |
getNumberOfValues()
Return the number of values contained in this response.
|
<T> T |
getValue(Class<T> clazz)
Get a single, resolved object from this response.
|
<T> T |
getValue(com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
Get a single, resolved object from this response.
|
List<RiakObject> |
getValues()
Get all the objects returned in this response.
|
<T> List<T> |
getValues(Class<T> clazz)
Get all the objects returned in this response.
|
<T> List<T> |
getValues(com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
Get the objects returned in this response.
|
VClock |
getVectorClock()
Get the vector clock returned with this response.
|
boolean |
hasValues()
Determine if this response contains any returned values.
|
boolean |
wasUpdated()
Determine if an update occurred.
|
public boolean wasUpdated()
The supplied Update
indicates if a modification was made. If
no modification was made, no store operation is performed and this
will return false.
Update
modified the retrieved object,
false otherwise.public boolean hasValues()
public int getNumberOfValues()
If siblings are present at the Location
, all values
are returned.
public List<RiakObject> getValues()
If siblings were present in Riak for the object you were fetching, this method will return all of them to you.
public VClock getVectorClock()
When storing/retrieving core Java types (HashMap
,
ArrayList
,String
, etc) or non-annotated POJOs
this method allows you to retrieve the vector clock.
public <T> List<T> getValues(Class<T> clazz)
If siblings were present in Riak for the object you were fetching, this method will return all of them to you.
The values will be converted to the supplied class using the
Converter
returned from the ConverterFactory
.
By default this will be the JSONConverter
,
or no conversion at all if you pass in RiakObject.class
.
clazz
- the class to be converted toConverterFactory
,
Converter
public <T> T getValue(Class<T> clazz) throws UnresolvedConflictException
The values will be converted to the supplied class using the
Converter
returned from the ConverterFactory
.
By default this will be the JSONConverter
,
or no conversion at all if you pass in RiakObject.class
. If there are multiple
values present (siblings), they will then be resolved using the
ConflictResolver
returned by the ConflictResolverFactory
.
clazz
- the class to be converted to.UnresolvedConflictException
ConverterFactory
,
Converter
,
ConflictResolverFactory
,
ConflictResolver
public <T> T getValue(com.fasterxml.jackson.core.type.TypeReference<T> typeReference) throws UnresolvedConflictException
The values will be converted to the supplied class using the
Converter
returned from the ConverterFactory
.
By default this will be the JSONConverter
,
or no conversion at all if you pass in RiakObject.class
. If there are multiple
values present (siblings), they will then be resolved using the
ConflictResolver
returned by the ConflictResolverFactory
.
This version should only be used if you're converting to a parameterized generic domain object. For example:
TypeReference<MyPojo<String>> tr = new TypeReference<MyPojo<String>>(){}; MyPojo<String> myPojo = response.getValue(tr);
typeReference
- The TypeReference of the class to be converted to.UnresolvedConflictException
ConverterFactory
,
Converter
,
ConflictResolverFactory
,
ConflictResolver
public <T> List<T> getValues(com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
If siblings were present in Riak for the object you were fetching, this method will return all of them to you.
The values will be converted to the supplied class using the
Converter
returned from the ConverterFactory
.
By default this will be the JSONConverter
,
or no conversion at all if you pass in a TypeReference for RiakObject.class
.
This version should only be used if you're converting to a parameterized generic domain object. For example:
TypeReference<MyPojo<String>> tr = new TypeReference<MyPojo<String>>(){}; List<MyPojo<String>> list = response.getValues(tr);
typeReference
- the TypeReference for the class to be converted toConverterFactory
,
Converter
Copyright © 2014. All rights reserved.