@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.datastore.v1.PartitionId)) { return super.equals(obj); } com.google.datastore.v1.PartitionId other = (com.google.datastore.v1.PartitionId) obj; boolean result = true; result = result && getProjectId().equals(other.getProjectId()); result = result && getNamespaceId().equals(other.getNamespaceId()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; hash = (53 * hash) + getProjectId().hashCode(); hash = (37 * hash) + NAMESPACE_ID_FIELD_NUMBER; hash = (53 * hash) + getNamespaceId().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The ID of the project to which the entities belong. * </pre> * * <code>string project_id = 2;</code> */ public Builder clearProjectId() { projectId_ = getDefaultInstance().getProjectId(); onChanged(); return this; } /**
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); }
public Builder mergeFrom(com.google.datastore.v1.PartitionId other) { if (other == com.google.datastore.v1.PartitionId.getDefaultInstance()) return this; if (!other.getProjectId().isEmpty()) { projectId_ = other.projectId_; onChanged(); } if (!other.getNamespaceId().isEmpty()) { namespaceId_ = other.namespaceId_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.datastore.v1.PartitionId)) { return super.equals(obj); } com.google.datastore.v1.PartitionId other = (com.google.datastore.v1.PartitionId) obj; boolean result = true; result = result && getProjectId().equals(other.getProjectId()); result = result && getNamespaceId().equals(other.getNamespaceId()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.datastore.v1.PartitionId)) { return super.equals(obj); } com.google.datastore.v1.PartitionId other = (com.google.datastore.v1.PartitionId) obj; boolean result = true; result = result && getProjectId() .equals(other.getProjectId()); result = result && getNamespaceId() .equals(other.getNamespaceId()); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; hash = (53 * hash) + getProjectId().hashCode(); hash = (37 * hash) + NAMESPACE_ID_FIELD_NUMBER; hash = (53 * hash) + getNamespaceId().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; hash = (53 * hash) + getProjectId().hashCode(); hash = (37 * hash) + NAMESPACE_ID_FIELD_NUMBER; hash = (53 * hash) + getNamespaceId().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * <pre> * The ID of the project to which the entities belong. * </pre> * * <code>optional string project_id = 2;</code> */ public Builder clearProjectId() { projectId_ = getDefaultInstance().getProjectId(); onChanged(); return this; } /**
/** * * * <pre> * The ID of the project to which the entities belong. * </pre> * * <code>string project_id = 2;</code> */ public Builder clearProjectId() { projectId_ = getDefaultInstance().getProjectId(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.datastore.v1.PartitionId other) { if (other == com.google.datastore.v1.PartitionId.getDefaultInstance()) return this; if (!other.getProjectId().isEmpty()) { projectId_ = other.projectId_; onChanged(); } if (!other.getNamespaceId().isEmpty()) { namespaceId_ = other.namespaceId_; onChanged(); } onChanged(); return this; }
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); }
public Builder mergeFrom(com.google.datastore.v1.PartitionId other) { if (other == com.google.datastore.v1.PartitionId.getDefaultInstance()) return this; if (!other.getProjectId().isEmpty()) { projectId_ = other.projectId_; onChanged(); } if (!other.getNamespaceId().isEmpty()) { namespaceId_ = other.namespaceId_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }