public ByteString getValue(){
return value;
}
RpbContent buildContent() {
Builder b =
RpbContent.newBuilder()
.setValue(value);
if (contentType != null) {
b.setContentType(ByteString.copyFromUtf8(contentType));
}
if (charset != null) {
b.setCharset(ByteString.copyFromUtf8(charset));
}
if (contentEncoding != null) {
b.setContentEncoding(ByteString.copyFromUtf8(contentEncoding));
}
if (vtag != null) {
b.setVtag(ByteString.copyFromUtf8(vtag));
}
if (links != null && links.size() != 0) {
for (RiakLink l : links) {
b.addLinks( l.build() );
}
}
if (lastModified != null) {
b.setLastMod(lastModified);
}
if (lastModifiedUsec != null) {
b.setLastModUsecs(lastModifiedUsec);
}
if (userMeta != null && !userMeta.isEmpty()) {
for (Map.Entry<String, String> ent : userMeta.entrySet()) {
ByteString key = ByteString.copyFromUtf8(ent.getKey());
com.trifork.riak.RPB.RpbPair.Builder pb = RPB.RpbPair.newBuilder().setKey(key);
if (ent.getValue() != null) {
pb.setValue(ByteString.copyFromUtf8(ent.getValue()));
}
b.addUsermeta(pb);
}
}
return b.build();
}