public abstract class AbstractDocument<T> extends Object implements Document<T>
Common parent implementation of a Document
.
It is recommended that all Document
implementations extend from this class so that parameter checks are consistently applied. It also ensures that equals and hashcode are applied on the contents and therefore comparisons work as expected.
Modifier | Constructor and Description |
---|---|
protected |
AbstractDocument(String id,
int expiry,
T content,
long cas) |
Modifier and Type | Method and Description |
---|---|
long |
cas()
The last-known CAS value for the
Document (0 if not set). |
T |
content()
The content of the
Document . |
boolean |
equals(Object o) |
int |
expiry()
The optional expiration time for the
Document (0 if not set). |
int |
hashCode() |
String |
id()
The per-bucket unique ID of the
Document . |
String |
toString() |
public String id()
Document
The per-bucket unique ID of the Document
.
public long cas()
Document
The last-known CAS value for the Document
(0 if not set).
public int expiry()
Document
The optional expiration time for the Document
(0 if not set).
Copyright © 2014 Couchbase, Inc.