public final class UnsavedRevision extends Revision
document, parentRevID| Modifier | Constructor and Description |
|---|---|
protected |
UnsavedRevision(Document document,
SavedRevision parentRevision)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAttachment(Attachment attachment,
java.lang.String name)
Creates or updates an attachment.
|
java.lang.String |
getId()
Gets the Revision's id.
|
SavedRevision |
getParent()
Gets the parent Revision.
|
java.lang.String |
getParentId()
Gets the parent Revision's id.
|
protected long |
getParentSequence() |
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
The contents of this revision of the document.
|
java.util.List<SavedRevision> |
getRevisionHistory()
Returns the history of this document as an array of CBLRevisions, in forward order.
|
protected long |
getSequence() |
void |
removeAttachment(java.lang.String name)
Deletes any existing attachment with the given name.
|
SavedRevision |
save()
Saves the new revision to the database.
|
SavedRevision |
save(boolean allowConflict)
A special variant of -save: that always adds the revision, even if its parent is not the
current revision of the document.
|
void |
setAttachment(java.lang.String name,
java.lang.String contentType,
java.io.InputStream contentStream)
Sets the attachment with the given name.
|
void |
setAttachment(java.lang.String name,
java.lang.String contentType,
java.net.URL contentStreamURL)
Sets the attachment with the given name.
|
void |
setIsDeletion(boolean isDeletion)
Set whether this revision is a deletion or not (eg, marks doc as deleted)
|
void |
setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
Set the properties for this revision
|
void |
setUserProperties(java.util.Map<java.lang.String,java.lang.Object> userProperties)
Sets the userProperties of the Revision.
|
equals, generationFromRevID, getAttachment, getAttachmentMetadata, getAttachmentNames, getAttachments, getDatabase, getDocument, getGeneration, getProperty, getUserProperties, hashCode, isDeletion, isGone, setParentRevisionID, toStringprotected UnsavedRevision(Document document, SavedRevision parentRevision)
public void setIsDeletion(boolean isDeletion)
public java.lang.String getId()
Revisionprotected long getSequence()
getSequence in class Revisionpublic void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
public SavedRevision save() throws CouchbaseLiteException
CouchbaseLiteExceptionpublic SavedRevision save(boolean allowConflict) throws CouchbaseLiteException
CouchbaseLiteExceptionpublic void removeAttachment(java.lang.String name)
name - The attachment name.public void setUserProperties(java.util.Map<java.lang.String,java.lang.Object> userProperties)
public void setAttachment(java.lang.String name,
java.lang.String contentType,
java.io.InputStream contentStream)
name - The name of the Attachment to set.contentType - The content-type of the Attachment.contentStream - The Attachment content. The InputStream will be closed
after it is no longer needed.public void setAttachment(java.lang.String name,
java.lang.String contentType,
java.net.URL contentStreamURL)
name - The name of the Attachment to set.contentType - The content-type of the Attachment.contentStreamURL - The URL that contains the Attachment content.public java.util.Map<java.lang.String,java.lang.Object> getProperties()
RevisiongetProperties in class Revisionpublic SavedRevision getParent()
Revisionpublic java.lang.String getParentId()
RevisiongetParentId in class Revisionprotected long getParentSequence()
public java.util.List<SavedRevision> getRevisionHistory() throws CouchbaseLiteException
RevisiongetRevisionHistory in class RevisionCouchbaseLiteExceptionprotected void addAttachment(Attachment attachment, java.lang.String name)
attachment - A newly-created Attachment (not yet associated with any revision)name - The attachment name.