public static class StoreOperation.Builder extends Object
Constructor and Description |
---|
StoreOperation.Builder(Location location)
Constructs a builder for a StoreOperation
|
StoreOperation.Builder(Namespace namespace)
Constructs a builder for a StoreOperation.
|
Modifier and Type | Method and Description |
---|---|
StoreOperation |
build() |
StoreOperation.Builder |
withAsis(boolean asis)
Set the asis value for this operation.
|
StoreOperation.Builder |
withContent(RiakObject content) |
StoreOperation.Builder |
withDw(int dw)
Set the DW value for this StoreOperation.
|
StoreOperation.Builder |
withIfNoneMatch(boolean ifNoneMatch)
Set the if_none_match flag value for this StoreOperation.
|
StoreOperation.Builder |
withIfNotModified(boolean ifNotModified)
Set the if_not_modified flag for this StoreOperation.
|
StoreOperation.Builder |
withNVal(int nval)
Set the n_val value for this operation.
|
StoreOperation.Builder |
withPw(int pw)
Set the PW value for this StoreOperation.
|
StoreOperation.Builder |
withReturnBody(boolean returnBody)
Return the object after storing (including any siblings).
|
StoreOperation.Builder |
withReturnHead(boolean returnHead)
Return the metadata after storing the value.
|
StoreOperation.Builder |
withSloppyQuorum(boolean sloppyQuorum)
Set whether to use sloppy_quorum.
|
StoreOperation.Builder |
withTimeout(int timeout)
Set a timeout for this operation.
|
StoreOperation.Builder |
withW(int w)
Set the W value for this StoreOperation.
|
public StoreOperation.Builder(Location location)
location
- The location in Riak at which to store.public StoreOperation.Builder(Namespace namespace)
Supplying only a Namespace causes the key to be generated by Riak.
namespace
- the namespace in Riak.public StoreOperation.Builder withContent(RiakObject content)
public StoreOperation.Builder withW(int w)
w
- the W value.public StoreOperation.Builder withDw(int dw)
dw
- the DW value.public StoreOperation.Builder withPw(int pw)
pw
- the PW value.public StoreOperation.Builder withReturnBody(boolean returnBody)
returnBody
- true to return the object.public StoreOperation.Builder withReturnHead(boolean returnHead)
Causes Riak to only return the metadata for the object. The value will be asSet to null.
returnHead
- true to return only metadata.public StoreOperation.Builder withIfNotModified(boolean ifNotModified)
Setting this to true means to update the value only if the vclock in the supplied object matches the one in the database.
Be aware there are several cases where this may not actually happen. Use of this feature is discouraged.
ifNotModified
- public StoreOperation.Builder withIfNoneMatch(boolean ifNoneMatch)
Setting this to true means store the value only if this bucket/key combination are not already defined.
Be aware that there are several cases where this may not actually happen. Use of this option is discouraged.ifNoneMatch
- the if_non-match value.public StoreOperation.Builder withAsis(boolean asis)
Do not use this unless you understand the ramifications
asis
- the asis valuepublic StoreOperation.Builder withTimeout(int timeout)
timeout
- a timeout in milliseconds.public StoreOperation.Builder withNVal(int nval)
Do not use this unless you understand the ramifications
nval
- the n_val valuepublic StoreOperation.Builder withSloppyQuorum(boolean sloppyQuorum)
Do not use this unless you understand the ramifications
sloppyQuorum
- true to use sloppy_quorumpublic StoreOperation build()
Copyright © 2014. All rights reserved.