@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public com.google.datastore.v1.AllocateIdsRequest buildPartial() { com.google.datastore.v1.AllocateIdsRequest result = new com.google.datastore.v1.AllocateIdsRequest(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.projectId_ = projectId_; if (keysBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002)) { keys_ = java.util.Collections.unmodifiableList(keys_); bitField0_ = (bitField0_ & ~0x00000002); } result.keys_ = keys_; } else { result.keys_ = keysBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; }
/** * * * <pre> * The ID of the project against which to make the request. * </pre> * * <code>string project_id = 8;</code> */ public Builder clearProjectId() { projectId_ = getDefaultInstance().getProjectId(); 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.AllocateIdsRequest)) { return super.equals(obj); } com.google.datastore.v1.AllocateIdsRequest other = (com.google.datastore.v1.AllocateIdsRequest) obj; boolean result = true; result = result && getProjectId().equals(other.getProjectId()); result = result && getKeysList().equals(other.getKeysList()); 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(); if (getKeysCount() > 0) { hash = (37 * hash) + KEYS_FIELD_NUMBER; hash = (53 * hash) + getKeysList().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) + getDescriptorForType().hashCode(); hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; hash = (53 * hash) + getProjectId().hashCode(); if (getKeysCount() > 0) { hash = (37 * hash) + KEYS_FIELD_NUMBER; hash = (53 * hash) + getKeysList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { for (int i = 0; i < keys_.size(); i++) { output.writeMessage(1, keys_.get(i)); } if (!getProjectIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 8, projectId_); } unknownFields.writeTo(output); }
public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; makeExtensionsImmutable();
@java.lang.Override public com.google.datastore.v1.AllocateIdsRequest build() { com.google.datastore.v1.AllocateIdsRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override public com.google.datastore.v1.AllocateIdsRequest getDefaultInstanceForType() { return com.google.datastore.v1.AllocateIdsRequest.getDefaultInstance(); }
keys_ = java.util.Collections.unmodifiableList(keys_); makeExtensionsImmutable();
@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(); if (getKeysCount() > 0) { hash = (37 * hash) + KEYS_FIELD_NUMBER; hash = (53 * hash) + getKeysList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.datastore.v1.AllocateIdsRequest)) { return super.equals(obj); } com.google.datastore.v1.AllocateIdsRequest other = (com.google.datastore.v1.AllocateIdsRequest) obj; boolean result = true; result = result && getProjectId() .equals(other.getProjectId()); result = result && getKeysList() .equals(other.getKeysList()); return result; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; for (int i = 0; i < keys_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, keys_.get(i)); } if (!getProjectIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, projectId_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public static Builder newBuilder(com.google.datastore.v1.AllocateIdsRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; makeExtensionsImmutable();
public com.google.datastore.v1.AllocateIdsRequest build() { com.google.datastore.v1.AllocateIdsRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override public com.google.datastore.v1.AllocateIdsRequest getDefaultInstanceForType() { return com.google.datastore.v1.AllocateIdsRequest.getDefaultInstance(); }
@Override public List<Key> allocateId(IncompleteKey... keys) { Preconditions.checkArgument( verifyIncompleteKeyType(keys), "keys must be IncompleteKey instances"); if (keys.length == 0) { return Collections.emptyList(); } com.google.datastore.v1.AllocateIdsRequest.Builder requestPb = com.google.datastore.v1.AllocateIdsRequest.newBuilder(); for (IncompleteKey key : keys) { requestPb.addKeys(trimNameOrId(key).toPb()); } com.google.datastore.v1.AllocateIdsResponse responsePb = allocateIds(requestPb.build()); ImmutableList.Builder<Key> keyList = ImmutableList.builder(); for (com.google.datastore.v1.Key keyPb : responsePb.getKeysList()) { keyList.add(Key.fromPb(keyPb)); } return keyList.build(); }