本文整理了Java中com.google.datastore.v1.Key.hasPartitionId()
方法的一些代码示例,展示了Key.hasPartitionId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Key.hasPartitionId()
方法的具体详情如下:
包路径:com.google.datastore.v1.Key
类名称:Key
方法名:hasPartitionId
[英]```
Entities are partitioned into subsets, currently identified by a project
ID and namespace ID.
Queries are scoped to a single partition.
`.google.datastore.v1.PartitionId partition_id = 1;`
[中]```
Entities are partitioned into subsets, currently identified by a project
ID and namespace ID.
Queries are scoped to a single partition.
.google.datastore.v1.PartitionId partition_id = 1;
代码示例来源:origin: googleapis/google-cloud-java
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.datastore.v1.Key)) {
return super.equals(obj);
}
com.google.datastore.v1.Key other = (com.google.datastore.v1.Key) obj;
boolean result = true;
result = result && (hasPartitionId() == other.hasPartitionId());
if (hasPartitionId()) {
result = result && getPartitionId().equals(other.getPartitionId());
}
result = result && getPathList().equals(other.getPathList());
result = result && unknownFields.equals(other.unknownFields);
return result;
}
代码示例来源:origin: googleapis/google-cloud-java
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasPartitionId()) {
hash = (37 * hash) + PARTITION_ID_FIELD_NUMBER;
hash = (53 * hash) + getPartitionId().hashCode();
}
if (getPathCount() > 0) {
hash = (37 * hash) + PATH_FIELD_NUMBER;
hash = (53 * hash) + getPathList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
代码示例来源:origin: googleapis/google-cloud-java
static IncompleteKey fromPb(com.google.datastore.v1.Key keyPb) {
String projectId = "";
String namespace = "";
if (keyPb.hasPartitionId()) {
com.google.datastore.v1.PartitionId partitionIdPb = keyPb.getPartitionId();
projectId = partitionIdPb.getProjectId();
namespace = partitionIdPb.getNamespaceId();
}
List<com.google.datastore.v1.Key.PathElement> pathElementsPb = keyPb.getPathList();
Preconditions.checkArgument(!pathElementsPb.isEmpty(), "Path must not be empty");
ImmutableList.Builder<PathElement> pathBuilder = ImmutableList.builder();
for (com.google.datastore.v1.Key.PathElement pathElementPb : pathElementsPb) {
pathBuilder.add(PathElement.fromPb(pathElementPb));
}
ImmutableList<PathElement> path = pathBuilder.build();
PathElement leaf = path.get(path.size() - 1);
if (leaf.getNameOrId() != null) {
return new Key(projectId, namespace, path);
}
return new IncompleteKey(projectId, namespace, path);
}
代码示例来源:origin: googleapis/google-cloud-java
public Builder mergeFrom(com.google.datastore.v1.Key other) {
if (other == com.google.datastore.v1.Key.getDefaultInstance()) return this;
if (other.hasPartitionId()) {
mergePartitionId(other.getPartitionId());
代码示例来源:origin: com.google.api.grpc/proto-google-cloud-datastore-v1
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.datastore.v1.Key)) {
return super.equals(obj);
}
com.google.datastore.v1.Key other = (com.google.datastore.v1.Key) obj;
boolean result = true;
result = result && (hasPartitionId() == other.hasPartitionId());
if (hasPartitionId()) {
result = result && getPartitionId().equals(other.getPartitionId());
}
result = result && getPathList().equals(other.getPathList());
result = result && unknownFields.equals(other.unknownFields);
return result;
}
代码示例来源:origin: com.google.cloud.datastore/datastore-v1-protos
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.datastore.v1.Key)) {
return super.equals(obj);
}
com.google.datastore.v1.Key other = (com.google.datastore.v1.Key) obj;
boolean result = true;
result = result && (hasPartitionId() == other.hasPartitionId());
if (hasPartitionId()) {
result = result && getPartitionId()
.equals(other.getPartitionId());
}
result = result && getPathList()
.equals(other.getPathList());
return result;
}
代码示例来源:origin: com.google.cloud.datastore/datastore-v1-protos
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptorForType().hashCode();
if (hasPartitionId()) {
hash = (37 * hash) + PARTITION_ID_FIELD_NUMBER;
hash = (53 * hash) + getPartitionId().hashCode();
}
if (getPathCount() > 0) {
hash = (37 * hash) + PATH_FIELD_NUMBER;
hash = (53 * hash) + getPathList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
代码示例来源:origin: com.google.api.grpc/proto-google-cloud-datastore-v1
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasPartitionId()) {
hash = (37 * hash) + PARTITION_ID_FIELD_NUMBER;
hash = (53 * hash) + getPartitionId().hashCode();
}
if (getPathCount() > 0) {
hash = (37 * hash) + PATH_FIELD_NUMBER;
hash = (53 * hash) + getPathList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
代码示例来源:origin: com.google.cloud/google-cloud-datastore
static IncompleteKey fromPb(com.google.datastore.v1.Key keyPb) {
String projectId = "";
String namespace = "";
if (keyPb.hasPartitionId()) {
com.google.datastore.v1.PartitionId partitionIdPb = keyPb.getPartitionId();
projectId = partitionIdPb.getProjectId();
namespace = partitionIdPb.getNamespaceId();
}
List<com.google.datastore.v1.Key.PathElement> pathElementsPb = keyPb.getPathList();
Preconditions.checkArgument(!pathElementsPb.isEmpty(), "Path must not be empty");
ImmutableList.Builder<PathElement> pathBuilder = ImmutableList.builder();
for (com.google.datastore.v1.Key.PathElement pathElementPb : pathElementsPb) {
pathBuilder.add(PathElement.fromPb(pathElementPb));
}
ImmutableList<PathElement> path = pathBuilder.build();
PathElement leaf = path.get(path.size() - 1);
if (leaf.getNameOrId() != null) {
return new Key(projectId, namespace, path);
}
return new IncompleteKey(projectId, namespace, path);
}
代码示例来源:origin: com.google.cloud.datastore/datastore-v1-protos
public Builder mergeFrom(com.google.datastore.v1.Key other) {
if (other == com.google.datastore.v1.Key.getDefaultInstance()) return this;
if (other.hasPartitionId()) {
mergePartitionId(other.getPartitionId());
代码示例来源:origin: com.google.api.grpc/proto-google-cloud-datastore-v1
public Builder mergeFrom(com.google.datastore.v1.Key other) {
if (other == com.google.datastore.v1.Key.getDefaultInstance()) return this;
if (other.hasPartitionId()) {
mergePartitionId(other.getPartitionId());
内容来源于网络,如有侵权,请联系作者删除!