本文整理汇总了Java中com.couchbase.lite.Status.isError方法的典型用法代码示例。如果您正苦于以下问题:Java Status.isError方法的具体用法?Java Status.isError怎么用?Java Status.isError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.couchbase.lite.Status
的用法示例。
在下文中一共展示了Status.isError方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: revisionObject
import com.couchbase.lite.Status; //导入方法依赖的package包/类
/**
* in CBLForestBridge.m
* + (CBL_MutableRevision*) revisionObjectFromForestDoc: (VersionedDocument&)doc
* revID: (NSString*)revID
* withBody: (BOOL)withBody
*/
public static RevisionInternal revisionObject(
Document doc,
String docID,
String revID,
boolean withBody) {
boolean deleted = doc.selectedRevDeleted();
if (revID == null)
revID = doc.getSelectedRevID();
RevisionInternal rev = new RevisionInternal(docID, revID, deleted);
rev.setSequence(doc.getSelectedSequence());
if (withBody) {
Status status = loadBodyOfRevisionObject(rev, doc);
if (status.isError() && status.getCode() != Status.GONE)
return null;
}
return rev;
}
示例2: getDocument
import com.couchbase.lite.Status; //导入方法依赖的package包/类
@Override
public RevisionInternal getDocument(String docID, String inRevID, boolean withBody, Status outStatus) {
Document doc = getDocument(docID);
if (doc == null)
return null;
try {
Status res = selectRev(doc, inRevID, withBody);
outStatus.setCode(res.getCode());
if (outStatus.isError() && outStatus.getCode() != Status.GONE)
return null;
if (inRevID == null && doc.selectedRevDeleted()) {
outStatus.setCode(Status.DELETED);
return null;
}
return ForestBridge.revisionObject(doc, docID, inRevID, withBody);
} finally {
doc.free();
}
}
示例3: getParentRevision
import com.couchbase.lite.Status; //导入方法依赖的package包/类
@Override
public RevisionInternal getParentRevision(RevisionInternal rev) {
if (rev.getDocID() == null || rev.getRevID() == null)
return null;
Document doc = getDocument(rev.getDocID());
if (doc == null)
return null;
try {
Status status = selectRev(doc, rev.getRevID(), true);
if (status.isError())
return null;
if (!doc.selectParentRev())
return null;
return ForestBridge.revisionObject(doc, rev.getDocID(), null, true);
} finally {
doc.free();
}
}
示例4: inTransaction
import com.couchbase.lite.Status; //导入方法依赖的package包/类
private Status inTransaction(Task task) {
if (inTransaction())
return task.run();
else {
if (!beginTransaction())
return new Status(Status.DB_ERROR);
boolean commit = false;
try {
Status status = task.run();
commit = !status.isError();
return status;
} finally {
if (!endTransaction(commit))
return new Status(Status.DB_ERROR);
}
}
}
示例5: loadRevisionBody
import com.couchbase.lite.Status; //导入方法依赖的package包/类
@Override
public RevisionInternal loadRevisionBody(RevisionInternal rev)
throws CouchbaseLiteException {
Document doc = _getDocument(rev.getDocID());
Status status = selectRev(doc, rev.getRevID(), true);
if (status.isError())
throw new CouchbaseLiteException(status);
status = ForestBridge.loadBodyOfRevisionObject(rev, doc);
if (status.isError())
throw new CouchbaseLiteException(status);
return rev;
}