public class RiakObjectBuilder extends Object
DefaultRiakObject
Modifier and Type | Method and Description |
---|---|
RiakObjectBuilder |
addIndex(String index,
long value)
Add a
RiakIndex to the new riak object's collection. |
RiakObjectBuilder |
addIndex(String index,
String value)
Add a
RiakIndex to the new riak object's collection. |
RiakObjectBuilder |
addLink(String bucket,
String key,
String tag)
Add a
RiakLink to the new riak object's collection. |
RiakObjectBuilder |
addUsermeta(String key,
String value)
Add an item of user meta data to the collection for the new Riak object.
|
IRiakObject |
build()
Construct a
DefaultRiakObject from this builders parameters |
static RiakObjectBuilder |
from(IRiakObject o)
Creates a builder prepopulated from the give
IRiakObject . |
static RiakObjectBuilder |
newBuilder(String bucket,
String key)
Static factory method
|
RiakObjectBuilder |
withContentType(String contentType)
The content-type of the data payload of the new Riak object.
|
RiakObjectBuilder |
withDeleted(boolean isDeleted) |
RiakObjectBuilder |
withIndexes(RiakIndexes indexes)
A Collection of
RiakIndex es for the new riak object |
RiakObjectBuilder |
withLastModified(long lastModified)
A
long timestamp of milliseconds since the epoch to set as
the last modified date on this Riak object |
RiakObjectBuilder |
withLinks(Collection<RiakLink> links)
A Collection of
RiakLink s for the new riak object |
RiakObjectBuilder |
withUsermeta(Map<String,String> usermeta)
A map of user meta data to set on the new riak object.
|
RiakObjectBuilder |
withValue(byte[] value)
The value to give the constructed riak object
|
RiakObjectBuilder |
withValue(String value)
Convenience method assumes a UTF-8 encoded string
|
RiakObjectBuilder |
withVClock(byte[] vclock)
The vector clock value for the constructed riak object
|
RiakObjectBuilder |
withVClock(VClock vclock)
The new Riak objects vector clock.
|
RiakObjectBuilder |
withVtag(String vtag)
The version tag for this riak object
|
public static RiakObjectBuilder newBuilder(String bucket, String key)
bucket
- key
- RiakObjectBuilder
public static RiakObjectBuilder from(IRiakObject o)
IRiakObject
.o
- the IRiakObject
to copyRiakObjectBuilder
with all fields set from
o
public IRiakObject build()
DefaultRiakObject
from this builders parametersIRiakObject
with the values from this builder.public RiakObjectBuilder withValue(byte[] value)
value
- byte[] or null. NOTE: will be cloned.public RiakObjectBuilder withValue(String value)
value
- a UTF-8 encoded stringpublic RiakObjectBuilder withVClock(byte[] vclock)
vclock
- the byte[] of a vector clock: NOTE: will be cloned.IllegalArgumentException
- for a null vclockpublic RiakObjectBuilder withVtag(String vtag)
vtag
- public RiakObjectBuilder withLastModified(long lastModified)
long
timestamp of milliseconds since the epoch to set as
the last modified date on this Riak objectlastModified
- public RiakObjectBuilder withLinks(Collection<RiakLink> links)
RiakLink
s for the new riak objectlinks
- the Collection
of RiakLink
s for the Riak
object, is copied over the current collection, not merged!
NOTE: this will be copied.public RiakObjectBuilder addLink(String bucket, String key, String tag)
RiakLink
to the new riak object's collection.bucket
- the bucket at the end of the linkkey
- the key at the end of the linktag
- the link tagpublic RiakObjectBuilder withIndexes(RiakIndexes indexes)
RiakIndex
es for the new riak objectindexes
- the Collection
of RiakIndex
es for the Riak
object, is copied over the current collection, not merged!
NOTE: this will be copied.public RiakObjectBuilder addIndex(String index, long value)
RiakIndex
to the new riak object's collection.index
- the RiakIndex
to addpublic RiakObjectBuilder addIndex(String index, String value)
RiakIndex
to the new riak object's collection.index
- the RiakIndex
to addpublic RiakObjectBuilder withUsermeta(Map<String,String> usermeta)
usermeta
- a Map
, copied over the current user meta (not merged):
NOTE: is copied.public RiakObjectBuilder addUsermeta(String key, String value)
key
- value
- public RiakObjectBuilder withContentType(String contentType)
contentType
- public RiakObjectBuilder withVClock(VClock vclock)
vclock
- public RiakObjectBuilder withDeleted(boolean isDeleted)
Copyright © 2013. All Rights Reserved.