@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.datastore.v1.AllocateIdsResponse)) { return super.equals(obj); } com.google.datastore.v1.AllocateIdsResponse other = (com.google.datastore.v1.AllocateIdsResponse) obj; boolean result = true; 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(); if (getKeysCount() > 0) { hash = (37 * hash) + KEYS_FIELD_NUMBER; hash = (53 * hash) + getKeysList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@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(); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.datastore.v1.AllocateIdsResponse)) { return super.equals(obj); } com.google.datastore.v1.AllocateIdsResponse other = (com.google.datastore.v1.AllocateIdsResponse) obj; boolean result = true; result = result && getKeysList() .equals(other.getKeysList()); 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.AllocateIdsResponse)) { return super.equals(obj); } com.google.datastore.v1.AllocateIdsResponse other = (com.google.datastore.v1.AllocateIdsResponse) obj; boolean result = true; result = result && getKeysList().equals(other.getKeysList()); result = result && unknownFields.equals(other.unknownFields); return result; }
static AllocateIdsResult build(final com.google.datastore.v1.AllocateIdsResponse response) { return new AllocateIdsResult(response.getKeysList()); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().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(); if (getKeysCount() > 0) { hash = (37 * hash) + KEYS_FIELD_NUMBER; hash = (53 * hash) + getKeysList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@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(); }