public static class StoreValue.Builder extends Object
Constructor and Description |
---|
StoreValue.Builder(Object value)
Construct a Builder for a StoreValue command.
|
StoreValue.Builder(Object value,
com.fasterxml.jackson.core.type.TypeReference<?> typeReference)
Construct a Builder for a StoreValue command.
|
Modifier and Type | Method and Description |
---|---|
StoreValue |
build()
Construct the StoreValue command.
|
StoreValue.Builder |
withLocation(Location location)
Set the location to store the object.
|
StoreValue.Builder |
withNamespace(Namespace namespace)
Set the namespace to store the object.
|
<T> StoreValue.Builder |
withOption(StoreValue.Option<T> option,
T value)
Add an optional setting for this command.
|
StoreValue.Builder |
withTimeout(int timeout)
Set the Riak-side timeout value.
|
StoreValue.Builder |
withVectorClock(VClock vclock)
Set the vector clock.
|
public StoreValue.Builder(Object value)
Prior to storing the object, it's raw type (class) will
be used to retrieve a converter from the ConverterFactory
.
For anything other than a RiakObject this is the JSONConverter
by default.
value
- The object to be stored in Riak.public StoreValue.Builder(Object value, com.fasterxml.jackson.core.type.TypeReference<?> typeReference)
Prior to storing the object, the supplied TypeReference will
be used to retrieve a converter from the ConverterFactory
.
For anything other than a RiakObject this is the JSONConverter
by default.
value
- The object to be stored in Riak.typeReference
- the TypeReference for the object.public StoreValue.Builder withLocation(Location location)
When storing a RiakObject or a POJO that does not have annotations for
the bucket and key, a Location
must be provided.
location
- the location to store the object in Riak.public StoreValue.Builder withNamespace(Namespace namespace)
When storing a POJO that does not have an annotation for the
bucket type and bucket, a Namespace
must be supplied.
namespace
- The namespaec to store the object.public StoreValue.Builder withTimeout(int timeout)
By default, riak has a 60s timeout for operations. Setting this value will override that default for this operation.
timeout
- the timeout in milliseconds to be sent to riak.public <T> StoreValue.Builder withOption(StoreValue.Option<T> option, T value)
option
- the optionvalue
- the value for the optionpublic StoreValue.Builder withVectorClock(VClock vclock)
When storing core Java types (HashMap
,
ArrayList
,String
, etc) or non-annotated POJOs this
method allows you to specify the vector clock retrieved from a
prior fetch operation.
vclock
- The vector clock to send to Riak.public StoreValue build()
Copyright © 2014. All rights reserved.