@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.language.v1beta2.Entity)) { return super.equals(obj); } com.google.cloud.language.v1beta2.Entity other = (com.google.cloud.language.v1beta2.Entity) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && type_ == other.type_; result = result && internalGetMetadata().equals(other.internalGetMetadata()); result = result && (java.lang.Float.floatToIntBits(getSalience()) == java.lang.Float.floatToIntBits(other.getSalience())); result = result && getMentionsList().equals(other.getMentionsList()); result = result && (hasSentiment() == other.hasSentiment()); if (hasSentiment()) { result = result && getSentiment().equals(other.getSentiment()); } 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) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + type_; if (!internalGetMetadata().getMap().isEmpty()) { hash = (37 * hash) + METADATA_FIELD_NUMBER; hash = (53 * hash) + internalGetMetadata().hashCode(); } hash = (37 * hash) + SALIENCE_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits(getSalience()); if (getMentionsCount() > 0) { hash = (37 * hash) + MENTIONS_FIELD_NUMBER; hash = (53 * hash) + getMentionsList().hashCode(); } if (hasSentiment()) { hash = (37 * hash) + SENTIMENT_FIELD_NUMBER; hash = (53 * hash) + getSentiment().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
if (other.hasSentiment()) { mergeSentiment(other.getSentiment());