@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + KIND_FIELD_NUMBER; hash = (53 * hash) + getKind().hashCode(); switch (idTypeCase_) { case 2: hash = (37 * hash) + ID_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getId()); break; case 3: hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); break; case 0: default: } 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.Key.PathElement)) { return super.equals(obj); } com.google.datastore.v1.Key.PathElement other = (com.google.datastore.v1.Key.PathElement) obj; boolean result = true; result = result && getKind().equals(other.getKind()); result = result && getIdTypeCase().equals(other.getIdTypeCase()); if (!result) return false; switch (idTypeCase_) { case 2: result = result && (getId() == other.getId()); break; case 3: result = result && getName().equals(other.getName()); break; case 0: default: } result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(com.google.datastore.v1.Key.PathElement other) { if (other == com.google.datastore.v1.Key.PathElement.getDefaultInstance()) return this; if (!other.getKind().isEmpty()) { kind_ = other.kind_; onChanged(); } switch (other.getIdTypeCase()) { case ID: { setId(other.getId()); break; } case NAME: { idTypeCase_ = 3; idType_ = other.idType_; onChanged(); break; } case IDTYPE_NOT_SET: { break; } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
public Builder mergeFrom(com.google.datastore.v1.Key.PathElement other) { if (other == com.google.datastore.v1.Key.PathElement.getDefaultInstance()) return this; if (!other.getKind().isEmpty()) { kind_ = other.kind_; onChanged(); } switch (other.getIdTypeCase()) { case ID: { setId(other.getId()); break; } case NAME: { idTypeCase_ = 3; idType_ = other.idType_; onChanged(); break; } case IDTYPE_NOT_SET: { break; } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); hash = (37 * hash) + KIND_FIELD_NUMBER; hash = (53 * hash) + getKind().hashCode(); switch (idTypeCase_) { case 2: hash = (37 * hash) + ID_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getId()); break; case 3: hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
public Builder mergeFrom(com.google.datastore.v1.Key.PathElement other) { if (other == com.google.datastore.v1.Key.PathElement.getDefaultInstance()) return this; if (!other.getKind().isEmpty()) { kind_ = other.kind_; onChanged(); } switch (other.getIdTypeCase()) { case ID: { setId(other.getId()); break; } case NAME: { idTypeCase_ = 3; idType_ = other.idType_; onChanged(); break; } case IDTYPE_NOT_SET: { break; } } onChanged(); return this; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + KIND_FIELD_NUMBER; hash = (53 * hash) + getKind().hashCode(); switch (idTypeCase_) { case 2: hash = (37 * hash) + ID_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getId()); break; case 3: hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); break; case 0: default: } 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.Key.PathElement)) { return super.equals(obj); } com.google.datastore.v1.Key.PathElement other = (com.google.datastore.v1.Key.PathElement) obj; boolean result = true; result = result && getKind() .equals(other.getKind()); result = result && getIdTypeCase().equals( other.getIdTypeCase()); if (!result) return false; switch (idTypeCase_) { case 2: result = result && (getId() == other.getId()); break; case 3: result = result && getName() .equals(other.getName()); break; case 0: default: } 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.PathElement)) { return super.equals(obj); } com.google.datastore.v1.Key.PathElement other = (com.google.datastore.v1.Key.PathElement) obj; boolean result = true; result = result && getKind().equals(other.getKind()); result = result && getIdTypeCase().equals(other.getIdTypeCase()); if (!result) return false; switch (idTypeCase_) { case 2: result = result && (getId() == other.getId()); break; case 3: result = result && getName().equals(other.getName()); break; case 0: default: } result = result && unknownFields.equals(other.unknownFields); return result; }
/** * * * <pre> * The kind of the entity. * A kind matching regex `__.*__` is reserved/read-only. * A kind must not contain more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. * </pre> * * <code>string kind = 1;</code> */ public Builder clearKind() { kind_ = getDefaultInstance().getKind(); onChanged(); return this; } /**
private int comparePathElement(PathElement thisElement, PathElement otherElement) { int result = thisElement.getKind().compareTo(otherElement.getKind()); if (result != 0) { return result; } if (thisElement.getIdTypeCase() == IdTypeCase.ID) { if (otherElement.getIdTypeCase() != IdTypeCase.ID) { return -1; } return Long.valueOf(thisElement.getId()).compareTo(otherElement.getId()); } if (otherElement.getIdTypeCase() == IdTypeCase.ID) { return 1; } return thisElement.getName().compareTo(otherElement.getName()); }
private int comparePathElement(PathElement thisElement, PathElement otherElement) { int result = thisElement.getKind().compareTo(otherElement.getKind()); if (result != 0) { return result; } if (thisElement.getIdTypeCase() == IdTypeCase.ID) { if (otherElement.getIdTypeCase() != IdTypeCase.ID) { return -1; } return Long.valueOf(thisElement.getId()).compareTo(otherElement.getId()); } if (otherElement.getIdTypeCase() == IdTypeCase.ID) { return 1; } return thisElement.getName().compareTo(otherElement.getName()); }
/** * <pre> * The kind of the entity. * A kind matching regex `__.*__` is reserved/read-only. * A kind must not contain more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. * </pre> * * <code>optional string kind = 1;</code> */ public Builder clearKind() { kind_ = getDefaultInstance().getKind(); onChanged(); return this; } /**
/** * Return element kind of key, or null if not set. * * This is a shortcut for {@code Key.getPath().get(Key.getPath().size() - 1).getKind()} * * @return the element kind. */ public String getKind() { final com.google.datastore.v1.Key.PathElement element = Iterables.getLast(key.getPathList(), null); if (element == null) { return null; } return element.getKind(); }
public String getKind() { return element.getKind(); }
static PathElement fromPb(com.google.datastore.v1.Key.PathElement pathElementPb) { String kind = pathElementPb.getKind(); switch (pathElementPb.getIdTypeCase()) { case ID: return of(kind, pathElementPb.getId()); case NAME: return of(kind, pathElementPb.getName()); default: return of(kind); } }
/** * * * <pre> * The kind of the entity. * A kind matching regex `__.*__` is reserved/read-only. * A kind must not contain more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. * </pre> * * <code>string kind = 1;</code> */ public Builder clearKind() { kind_ = getDefaultInstance().getKind(); onChanged(); return this; } /**
static PathElement fromPb(com.google.datastore.v1.Key.PathElement pathElementPb) { String kind = pathElementPb.getKind(); switch (pathElementPb.getIdTypeCase()) { case ID: return of(kind, pathElementPb.getId()); case NAME: return of(kind, pathElementPb.getName()); default: return of(kind); } }