Class Document

java.lang.Object
org.lightcouch.Document
Direct Known Subclasses:
DesignDocument, ReplicatorDocument

public class Document extends Object
Convenient base class for CouchDB documents, defines the basic id, revision properties, and attachments.
Since:
0.0.2
  • Field Details

    • id

      @SerializedName("_id") private String id
    • revision

      @SerializedName("_rev") private String revision
    • attachments

      @SerializedName("_attachments") private Map<String,Attachment> attachments
  • Constructor Details

    • Document

      public Document()
    • Document

      public Document(Document other)
      Copy contructor that does a deep copy
      Parameters:
      other - The document to copy.
  • Method Details

    • getId

      public String getId()
    • getRevision

      public String getRevision()
    • getAttachments

      public Map<String,Attachment> getAttachments()
    • setId

      public void setId(String id)
    • setRevision

      public void setRevision(String revision)
    • setAttachments

      public void setAttachments(Map<String,Attachment> attachments)
    • addAttachment

      public void addAttachment(String name, Attachment attachment)
      Adds an in-line document attachment.
      Parameters:
      name - The attachment file name
      attachment - The attachment instance
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object