|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IRiakObject
Represents the data and meta data stored in Riak at a bucket/key.
Although you can store your own Java Beans in Riak, this interface represents the core data type that is passed between the low and high level APIs and that all POJOs are converted to and from when stored or fetched.
Extends Iterable
to provide a simple way to iterate over the
collection of RiakLink
s.
NOTE: The name will be changing soon. The initial Java client release laid claim to the best name real estate. This class will be named RiakObject in subsequent releases.
Method Summary | |
---|---|
IRiakObject |
addIndex(String index,
int value)
Add an int index to this objects indexes. |
IRiakObject |
addIndex(String index,
String value)
Add a String index to this objects indexes. |
IRiakObject |
addLink(RiakLink link)
Add link to this RiakObject's links. |
IRiakObject |
addUsermeta(String key,
String value)
Adds the key, value to the collection of user meta data for this object. |
Map<BinIndex,Set<String>> |
allBinIndexes()
Secondary indexes for this object. |
Map<IntIndex,Set<Integer>> |
allIntIndexes()
Secondary indexes for this object. |
Set<String> |
getBinIndex(String string)
Get a copy of the values for the given bin index |
String |
getBucket()
The name of this objects bucket |
String |
getContentType()
The content-type of this object's value. |
Set<Integer> |
getIntIndex(String string)
Get a copy of the values for the given bin index |
String |
getKey()
The object's key. |
Date |
getLastModified()
The last modified date as held by Riak. |
List<RiakLink> |
getLinks()
A List of RiakLink s from this object. |
Map<String,String> |
getMeta()
User meta data can be added to any Riak object. |
String |
getUsermeta(String key)
Get the user meta data item for that key. |
byte[] |
getValue()
The value. |
String |
getValueAsString()
Convenience method. |
VClock |
getVClock()
This objects Vector Clock. |
String |
getVClockAsString()
String copy of this object's vector clock. |
String |
getVtag()
If this object has a version tag (if it is one of a set of siblings) |
boolean |
hasLink(RiakLink riakLink)
Does this object have that link? |
boolean |
hasLinks()
Does this object link to any others? |
boolean |
hasUsermeta()
Does this object have any user meta data? |
boolean |
hasUsermeta(String key)
Does this object have a meta data item for that key? |
int |
numLinks()
How many RiakLink s does this object have. |
IRiakObject |
removeBinIndex(String index)
Remove a BinIndex from this RiakObject. |
IRiakObject |
removeIntIndex(String index)
Remove a IntIndex from this RiakObject. |
IRiakObject |
removeLink(RiakLink link)
Remove a RiakLink from this RiakObject. |
IRiakObject |
removeUsermeta(String key)
Remove that item of user meta data. |
void |
setContentType(String contentType)
Set the content-type of this object's payload. |
void |
setValue(byte[] value)
Set this IRiakObject's value. |
void |
setValue(String value)
Convenience method that will result in value being turned into a byte[] array using charset utf-8 and also will result in charset=utf-8 being appended to the content-type for this object |
Iterable<Map.Entry<String,String>> |
userMetaEntries()
An iterable view on the user meta entries. |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Method Detail |
---|
String getBucket()
byte[] getValue()
String getValueAsString()
VClock getVClock()
VClock
for this object.String getVClockAsString()
String getKey()
String getVtag()
Date getLastModified()
String getContentType()
DefaultRiakObject.DEFAULT_CONTENT_TYPE
List<RiakLink> getLinks()
RiakLink
s from this object. See also Link Walking on the basho
site.
RiakLink
,
LinkWalk
boolean hasLinks()
int numLinks()
RiakLink
s does this object have.
boolean hasLink(RiakLink riakLink)
riakLink
- a RiakLink
RiakLink
, false otherwise.Map<String,String> getMeta()
Map
of meta data for this object.boolean hasUsermeta()
boolean hasUsermeta(String key)
key
-
String getUsermeta(String key)
key
- the name of the user meta data item
Iterable<Map.Entry<String,String>> userMetaEntries()
Map.Entry
Map<BinIndex,Set<String>> allBinIndexes()
Set<String> getBinIndex(String string)
string
- the index name
Map<IntIndex,Set<Integer>> allIntIndexes()
Set<Integer> getIntIndex(String string)
string
- the index name
void setValue(byte[] value)
value
- the byte[] to set.void setValue(String value)
value
- the String valuevoid setContentType(String contentType)
contentType
- the content-type of this object's value (EG
text/plain;charset=utf-8)IRiakObject addLink(RiakLink link)
link
- a RiakLink
to add.
IRiakObject removeLink(RiakLink link)
RiakLink
from this RiakObject.
link
- the RiakLink
to remove
IRiakObject addUsermeta(String key, String value)
key
- value
-
IRiakObject removeUsermeta(String key)
key
- the key of the item to removeIRiakObject addIndex(String index, String value)
index
- index namevalue
- index value
IRiakObject addIndex(String index, int value)
index
- index namevalue
- index value
IRiakObject removeBinIndex(String index)
BinIndex
from this RiakObject.
index
- the name of the bin index to remove
IRiakObject removeIntIndex(String index)
IntIndex
from this RiakObject.
index
- the name of the int index to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |