com.google.cloud.Timestamp.equals()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中com.google.cloud.Timestamp.equals()方法的一些代码示例,展示了Timestamp.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Timestamp.equals()方法的具体详情如下:
包路径:com.google.cloud.Timestamp
类名称:Timestamp
方法名:equals

Timestamp.equals介绍

暂无

代码示例

代码示例来源:origin: googleapis/google-cloud-java

@Override
boolean valueEquals(Value v) {
 if (isCommitTimestamp) {
  return v.isCommitTimestamp();
 }
 if (v.isCommitTimestamp()) {
  return isCommitTimestamp;
 }
 return ((TimestampImpl) v).value.equals(value);
}

代码示例来源:origin: googleapis/google-cloud-java

/**
 * Applies a document modification to the document tree. Returns the DocumentChange event for
 * successful modifications.
 */
@Nullable
private DocumentChange modifyDoc(QueryDocumentSnapshot newDocument) {
 ResourcePath resourcePath = newDocument.getReference().getResourcePath();
 DocumentSnapshot oldDocument = documentSet.getDocument(resourcePath);
 if (!oldDocument.getUpdateTime().equals(newDocument.getUpdateTime())) {
  int oldIndex = documentSet.indexOf(resourcePath);
  documentSet = documentSet.remove(resourcePath);
  documentSet = documentSet.add(newDocument);
  int newIndex = documentSet.indexOf(resourcePath);
  return new DocumentChange(newDocument, Type.MODIFIED, oldIndex, newIndex);
 }
 return null;
};

代码示例来源:origin: com.google.cloud/google-cloud-spanner

@Override
boolean valueEquals(Value v) {
 if (isCommitTimestamp) {
  return v.isCommitTimestamp();
 }
 if (v.isCommitTimestamp()) {
  return isCommitTimestamp;
 }
 return ((TimestampImpl) v).value.equals(value);
}

代码示例来源:origin: com.google.cloud/google-cloud-firestore

/**
 * Applies a document modification to the document tree. Returns the DocumentChange event for
 * successful modifications.
 */
@Nullable
private DocumentChange modifyDoc(QueryDocumentSnapshot newDocument) {
 ResourcePath resourcePath = newDocument.getReference().getResourcePath();
 DocumentSnapshot oldDocument = documentSet.getDocument(resourcePath);
 if (!oldDocument.getUpdateTime().equals(newDocument.getUpdateTime())) {
  int oldIndex = documentSet.indexOf(resourcePath);
  documentSet = documentSet.remove(resourcePath);
  documentSet = documentSet.add(newDocument);
  int newIndex = documentSet.indexOf(resourcePath);
  return new DocumentChange(newDocument, Type.MODIFIED, oldIndex, newIndex);
 }
 return null;
};

相关文章