public abstract class Revision
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected Document |
document
The document this is a revision of
|
protected java.lang.String |
parentRevID
The ID of the parentRevision.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Revision(Document document)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o)
Compare this revision to the given revision to check for equality.
|
static int |
generationFromRevID(java.lang.String revID) |
Attachment |
getAttachment(java.lang.String name)
Looks up the attachment with the given name (without fetching its contents yet).
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getAttachmentMetadata() |
java.util.List<java.lang.String> |
getAttachmentNames()
The names of all attachments
|
java.util.List<Attachment> |
getAttachments()
All attachments, as Attachment objects.
|
Database |
getDatabase()
Get the revision's owning database.
|
Document |
getDocument()
Get the document this is a revision of.
|
protected int |
getGeneration()
Generation number: 1 for a new document, 2 for the 2nd revision, ...
|
abstract java.lang.String |
getId()
Gets the Revision's id.
|
abstract SavedRevision |
getParent()
Gets the parent Revision.
|
abstract java.lang.String |
getParentId()
Gets the parent Revision's id.
|
abstract java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
The contents of this revision of the document.
|
java.lang.Object |
getProperty(java.lang.String key)
Shorthand for getProperties().get(key)
|
abstract java.util.List<SavedRevision> |
getRevisionHistory()
Returns the history of this document as an array of CBLRevisions, in forward order.
|
protected abstract long |
getSequence() |
java.util.Map<java.lang.String,java.lang.Object> |
getUserProperties()
The user-defined properties, without the ones reserved by CouchDB.
|
int |
hashCode()
Custom hashCode based on the hash code of the Document Id and the Revision Id
|
boolean |
isDeletion()
Does this revision mark the deletion of its document?
(In other words, does it have a "_deleted" property?)
|
boolean |
isGone()
Does this revision mark the deletion or removal (from available channels) of its document?
(In other words, does it have a "_deleted_ or "_removed" property?)
|
protected void |
setParentRevisionID(java.lang.String parentRevID) |
java.lang.String |
toString()
Returns a string representation of this Revision, including the Document Id, the Revision Id
and whether or not this Revision is a deletion.
|
protected Document document
protected java.lang.String parentRevID
protected Revision(Document document)
public Database getDatabase()
public Document getDocument()
public abstract java.lang.String getId()
public boolean isDeletion()
public abstract java.util.Map<java.lang.String,java.lang.Object> getProperties()
public java.util.Map<java.lang.String,java.lang.Object> getUserProperties()
public java.util.List<java.lang.String> getAttachmentNames()
public java.util.List<Attachment> getAttachments()
public java.lang.Object getProperty(java.lang.String key)
public Attachment getAttachment(java.lang.String name)
public abstract SavedRevision getParent()
public abstract java.lang.String getParentId()
public abstract java.util.List<SavedRevision> getRevisionHistory() throws CouchbaseLiteException
CouchbaseLiteExceptionpublic boolean isGone()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the revision to check for equality againstpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectprotected java.util.Map<java.lang.String,java.lang.Object> getAttachmentMetadata()
protected void setParentRevisionID(java.lang.String parentRevID)
protected abstract long getSequence()
protected int getGeneration()
public static int generationFromRevID(java.lang.String revID)