@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; }
result = result && (hasPartitionId() == other.hasPartitionId()); if (hasPartitionId()) { result = result && getPartitionId().equals(other.getPartitionId());
@Override public int compare(Key thisKey, Key otherKey) { if (!thisKey.getPartitionId().equals(otherKey.getPartitionId())) { throw new IllegalArgumentException("Cannot compare keys with different partition ids."); } Iterator<PathElement> thisPath = thisKey.getPathList().iterator(); Iterator<PathElement> otherPath = otherKey.getPathList().iterator(); while (thisPath.hasNext()) { if (!otherPath.hasNext()) { return 1; } int result = comparePathElement(thisPath.next(), otherPath.next()); if (result != 0) { return result; } } return otherPath.hasNext() ? -1 : 0; } }
@Override public int compare(Key thisKey, Key otherKey) { if (!thisKey.getPartitionId().equals(otherKey.getPartitionId())) { throw new IllegalArgumentException("Cannot compare keys with different partition ids."); } Iterator<PathElement> thisPath = thisKey.getPathList().iterator(); Iterator<PathElement> otherPath = otherKey.getPathList().iterator(); while (thisPath.hasNext()) { if (!otherPath.hasNext()) { return 1; } int result = comparePathElement(thisPath.next(), otherPath.next()); if (result != 0) { return result; } } return otherPath.hasNext() ? -1 : 0; } }
@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; }
@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; }
if (partitionId == null) { partitionId = subKey.getPartitionId(); } else if (!partitionId.equals(subKey.getPartitionId())) { throw new IllegalArgumentException("Partition IDs did not match, found: " + partitionId + " and " + subKey.getPartitionId()); if (partitionId != null && !partitionId.equals(PartitionId.getDefaultInstance())) { key.setPartitionId(partitionId);
if (partitionId == null) { partitionId = subKey.getPartitionId(); } else if (!partitionId.equals(subKey.getPartitionId())) { throw new IllegalArgumentException("Partition IDs did not match, found: " + partitionId + " and " + subKey.getPartitionId()); if (partitionId != null && !partitionId.equals(PartitionId.getDefaultInstance())) { key.setPartitionId(partitionId);
result = result && (hasPartitionId() == other.hasPartitionId()); if (hasPartitionId()) { result = result && getPartitionId().equals(other.getPartitionId());
if (hasPartitionId()) { result = result && getPartitionId() .equals(other.getPartitionId());