|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.basho.riak.client.builders.RiakObjectBuilder
public class RiakObjectBuilder
Creates instances of DefaultRiakObject
Method Summary | |
---|---|
RiakObjectBuilder |
addIndex(String index,
int 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 |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static RiakObjectBuilder newBuilder(String bucket, String key)
bucket
- key
-
RiakObjectBuilder
public static RiakObjectBuilder from(IRiakObject o)
IRiakObject
.
o
- the IRiakObject
to copy
RiakObjectBuilder
with all fields set from
o
public IRiakObject build()
DefaultRiakObject
from this builders parameters
IRiakObject
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 string
public 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 object
lastModified
-
public RiakObjectBuilder withLinks(Collection<RiakLink> links)
RiakLink
s for the new riak object
links
- 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 tag
public RiakObjectBuilder withIndexes(RiakIndexes indexes)
RiakIndex
es for the new riak object
indexes
- 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, int value)
RiakIndex
to the new riak object's collection.
index
- the RiakIndex
to add
public RiakObjectBuilder addIndex(String index, String value)
RiakIndex
to the new riak object's collection.
index
- the RiakIndex
to add
public 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
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |