com.basho.riak.pbc
Class RiakObject

java.lang.Object
  extended by com.basho.riak.pbc.RiakObject

public class RiakObject
extends Object

PBC model of the data/meta data for a bucket/key entry in Riak


Constructor Summary
RiakObject(com.google.protobuf.ByteString bucket, com.google.protobuf.ByteString key, com.google.protobuf.ByteString content)
           
RiakObject(com.google.protobuf.ByteString vclock, com.google.protobuf.ByteString bucket, com.google.protobuf.ByteString key, com.google.protobuf.ByteString content)
           
RiakObject(String bucket, String key, byte[] content)
           
RiakObject(String bucket, String key, String content)
           
 
Method Summary
 RiakObject addIndex(String name, int value)
          Add an int index to this object
 RiakObject addIndex(String name, String value)
          Add a binary index to the object
 void addLink(com.google.protobuf.ByteString tag, com.google.protobuf.ByteString bucket, com.google.protobuf.ByteString key)
           
 void addLink(String tag, String bucket, String key)
           
 RiakObject addUsermetaItem(String key, String value)
          Add an item to the user meta data for this RiakObject.
 String getBucket()
           
 com.google.protobuf.ByteString getBucketBS()
           
 String getCharset()
           
 String getContentType()
           
 List<RiakIndex> getIndexes()
           
 String getKey()
           
 com.google.protobuf.ByteString getKeyBS()
           
 Date getLastModified()
           
 List<RiakLink> getLinks()
           
 Map<String,String> getUsermeta()
          Return a copy of the user meta data map (does not read or write through to map backing RiakObject)
 com.google.protobuf.ByteString getValue()
           
 com.google.protobuf.ByteString getVclock()
           
 String getVtag()
           
 void setCharset(String charset)
           
 void setContentType(String contentType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RiakObject

public RiakObject(com.google.protobuf.ByteString vclock,
                  com.google.protobuf.ByteString bucket,
                  com.google.protobuf.ByteString key,
                  com.google.protobuf.ByteString content)

RiakObject

public RiakObject(com.google.protobuf.ByteString bucket,
                  com.google.protobuf.ByteString key,
                  com.google.protobuf.ByteString content)

RiakObject

public RiakObject(String bucket,
                  String key,
                  byte[] content)

RiakObject

public RiakObject(String bucket,
                  String key,
                  String content)
Method Detail

getBucketBS

public com.google.protobuf.ByteString getBucketBS()

getBucket

public String getBucket()

getKeyBS

public com.google.protobuf.ByteString getKeyBS()

getKey

public String getKey()

getVclock

public com.google.protobuf.ByteString getVclock()

getValue

public com.google.protobuf.ByteString getValue()

getVtag

public String getVtag()

setContentType

public void setContentType(String contentType)

setCharset

public void setCharset(String charset)

addLink

public void addLink(String tag,
                    String bucket,
                    String key)

addLink

public void addLink(com.google.protobuf.ByteString tag,
                    com.google.protobuf.ByteString bucket,
                    com.google.protobuf.ByteString key)

getLinks

public List<RiakLink> getLinks()

getUsermeta

public Map<String,String> getUsermeta()
Return a copy of the user meta data map (does not read or write through to map backing RiakObject)

Returns:
a Map of the user map as it is at method call time

addUsermetaItem

public RiakObject addUsermetaItem(String key,
                                  String value)
Add an item to the user meta data for this RiakObject.

Parameters:
key - the key of the user meta data item
value - the user meta data item
Returns:
this RiakObject

getLastModified

public Date getLastModified()
Returns:
the lastModified

getContentType

public String getContentType()
Returns:
the content type

getCharset

public String getCharset()

getIndexes

public List<RiakIndex> getIndexes()
Returns:
a *copy* of the list of RiakIndexes for this object

addIndex

public RiakObject addIndex(String name,
                           String value)
Add a binary index to the object

Parameters:
name - of the index
value - the value to add to the index
Returns:
this

addIndex

public RiakObject addIndex(String name,
                           int value)
Add an int index to this object

Parameters:
name - of the index
value - the value to add to the index
Returns:
this


Copyright © 2012. All Rights Reserved.