public static class UpdateValue.Builder extends Object
Constructor and Description |
---|
Builder(Location location)
Construct a Builder for an UpdateValue command.
|
Modifier and Type | Method and Description |
---|---|
UpdateValue |
build()
Construct the UpdateValue command.
|
<U> UpdateValue.Builder |
withFetchOption(FetchValue.Option<U> option,
U value)
Add an option for the fetch phase of the update.
|
<U> UpdateValue.Builder |
withStoreOption(StoreValue.Option<U> option,
U value)
Add an option for the store phase of the update.
|
UpdateValue.Builder |
withTimeout(int timeout)
Set the Riak-side timeout value.
|
UpdateValue.Builder |
withUpdate(UpdateValue.Update<?> update)
Supply the Update.
|
<T> UpdateValue.Builder |
withUpdate(UpdateValue.Update<T> update,
com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
Supply the Update with a TypeReference.
|
public Builder(Location location)
location
- the location of the object in Riak to update.public <U> UpdateValue.Builder withFetchOption(FetchValue.Option<U> option, U value)
U
- the type of the option's valueoption
- the optionvalue
- the option's valuepublic <U> UpdateValue.Builder withStoreOption(StoreValue.Option<U> option, U value)
U
- the type of the option's valueoption
- the optionvalue
- the option's valuepublic UpdateValue.Builder withUpdate(UpdateValue.Update<?> update)
During the update operation, the fetched value needs to be converted
before being passed to the ConflictResolver
and the Update
method.
Supplying only an Update<T>
means the raw type of T
will be used to retrieve the Converter
and ConflictResolver
to be used.
update
- The Update
instanceConverter
,
ConverterFactory
,
ConflictResolver
,
ConflictResolverFactory
public <T> UpdateValue.Builder withUpdate(UpdateValue.Update<T> update, com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
During the update operation, the fetched value needs to be converted
before being passed to the ConflictResolver
and the Update
method. If your domain object is a parameterized type you will need to supply
a TypeReference
so the appropriate ConflictResolver
and Converter
can be found.
update
- The Update
instancetypeReference
- the TypeReference
for the class used for conversion.Converter
,
ConverterFactory
,
ConflictResolver
,
ConflictResolverFactory
public UpdateValue.Builder withTimeout(int timeout)
By default, riak has a 60s timeout for operations. Setting this value will override that default for both the fetch and store operation.
timeout
- the timeout in milliseconds to be sent to riak.public UpdateValue build()
Copyright © 2016. All rights reserved.