public class DocumentRevisionBuilder
extends java.lang.Object
Build DocumentRevision
s in a chained manner.
Constructor and Description |
---|
DocumentRevisionBuilder() |
Modifier and Type | Method and Description |
---|---|
BasicDocumentRevision |
build()
Builds and returns the
BasicDocumentRevision for this builder. |
BasicDocumentRevision |
buildLocalDocument()
Builds and returns the
DocumentRevision for this builder, as a
local document. |
MutableDocumentRevision |
buildMutable()
Builds and returns the
MutableDocumentRevision for this builder. |
ProjectedDocumentRevision |
buildProjected()
Builds and returns the
ProjectedDocumentRevision for this builder. |
static BasicDocumentRevision |
buildRevisionFromMap(java.net.URI documentURI,
java.util.Map<java.lang.String,? extends java.lang.Object> map)
Builds a BasicDocumentRevision from a Map of values from a CouchDB instance
|
BasicDocumentRevision |
buildStub()
Builds and returns the stub
DocumentRevision for this builder. |
DocumentRevisionBuilder |
setAttachments(java.util.List<? extends Attachment> attachments)
Sets the attachments associated with the document for this builder.
|
DocumentRevisionBuilder |
setBody(DocumentBody body)
Sets the document body for this builder.
|
DocumentRevisionBuilder |
setCurrent(boolean current)
Sets whether this builder is creating the winning revision.
|
DocumentRevisionBuilder |
setDatastore(Datastore datastore)
Sets the datastore for this builder.
|
DocumentRevisionBuilder |
setDeleted(boolean deleted)
Sets whether this builder is creating a deleted revsion.
|
DocumentRevisionBuilder |
setDocId(java.lang.String docId)
Sets the document ID for this builder.
|
DocumentRevisionBuilder |
setInternalId(long internalId)
Sets the internal ID for this builder.
|
DocumentRevisionBuilder |
setParent(long parent)
Sets the parent sequence number for this builder.
|
DocumentRevisionBuilder |
setRevId(java.lang.String revId)
Sets the revision ID for this builder.
|
DocumentRevisionBuilder |
setSequence(long sequence)
Sets the sequence number for this builder.
|
public BasicDocumentRevision build()
Builds and returns the BasicDocumentRevision
for this builder.
BasicDocumentRevision
for this builderpublic BasicDocumentRevision buildLocalDocument()
Builds and returns the DocumentRevision
for this builder, as a
local document.
DocumentRevision
for this builder as a local documentpublic BasicDocumentRevision buildStub()
Builds and returns the stub DocumentRevision
for this builder.
A "stub" object has document and revision IDs, but no content/body.
DocumentRevision
for this builderpublic DocumentRevisionBuilder setDocId(java.lang.String docId)
Sets the document ID for this builder.
docId
- document IDpublic DocumentRevisionBuilder setRevId(java.lang.String revId)
Sets the revision ID for this builder.
revId
- revision IDpublic DocumentRevisionBuilder setBody(DocumentBody body)
Sets the document body for this builder.
body
- document revision bodypublic DocumentRevisionBuilder setCurrent(boolean current)
Sets whether this builder is creating the winning revision.
current
- whether this document revision is the winning revisionpublic DocumentRevisionBuilder setDeleted(boolean deleted)
Sets whether this builder is creating a deleted revsion.
deleted
- whether this revision is deletedpublic DocumentRevisionBuilder setInternalId(long internalId)
Sets the internal ID for this builder.
internalId
- revision internal IDpublic DocumentRevisionBuilder setSequence(long sequence)
Sets the sequence number for this builder.
sequence
- sequence numberpublic DocumentRevisionBuilder setParent(long parent)
Sets the parent sequence number for this builder.
parent
- parent sequence numberpublic DocumentRevisionBuilder setAttachments(java.util.List<? extends Attachment> attachments)
Sets the attachments associated with the document for this builder.
attachments
- list of attachments associated with the documentpublic DocumentRevisionBuilder setDatastore(Datastore datastore)
Sets the datastore for this builder.
datastore
- the datastorepublic MutableDocumentRevision buildMutable()
MutableDocumentRevision
for this builder.MutableDocumentRevision
for this builder.public ProjectedDocumentRevision buildProjected()
ProjectedDocumentRevision
for this builder.ProjectedDocumentRevision
for this builder.public static BasicDocumentRevision buildRevisionFromMap(java.net.URI documentURI, java.util.Map<java.lang.String,? extends java.lang.Object> map) throws java.io.IOException
documentURI
- The URI of the documentmap
- The map of key value pairs fom the CouchDB serverjava.io.IOException
- If attachments fail to be decoded correctly.