/** * * * <pre> * For calls to [AnalyzeEntitySentiment][] or if * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to * true, this field will contain the sentiment expressed for this mention of * the entity in the provided document. * </pre> * * <code>.google.cloud.language.v1beta2.Sentiment sentiment = 3;</code> */ public com.google.cloud.language.v1beta2.SentimentOrBuilder getSentimentOrBuilder() { return getSentiment(); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (text_ != null) { output.writeMessage(1, getText()); } if (type_ != com.google.cloud.language.v1beta2.EntityMention.Type.TYPE_UNKNOWN.getNumber()) { output.writeEnum(2, type_); } if (sentiment_ != null) { output.writeMessage(3, getSentiment()); } unknownFields.writeTo(output); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (text_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getText()); } if (type_ != com.google.cloud.language.v1beta2.EntityMention.Type.TYPE_UNKNOWN.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_); } if (sentiment_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSentiment()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasText()) { hash = (37 * hash) + TEXT_FIELD_NUMBER; hash = (53 * hash) + getText().hashCode(); } hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + type_; if (hasSentiment()) { hash = (37 * hash) + SENTIMENT_FIELD_NUMBER; hash = (53 * hash) + getSentiment().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.cloud.language.v1beta2.EntityMention)) { return super.equals(obj); } com.google.cloud.language.v1beta2.EntityMention other = (com.google.cloud.language.v1beta2.EntityMention) obj; boolean result = true; result = result && (hasText() == other.hasText()); if (hasText()) { result = result && getText().equals(other.getText()); } result = result && type_ == other.type_; result = result && (hasSentiment() == other.hasSentiment()); if (hasSentiment()) { result = result && getSentiment().equals(other.getSentiment()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(com.google.cloud.language.v1beta2.EntityMention other) { if (other == com.google.cloud.language.v1beta2.EntityMention.getDefaultInstance()) return this; if (other.hasText()) { mergeText(other.getText()); } if (other.type_ != 0) { setTypeValue(other.getTypeValue()); } if (other.hasSentiment()) { mergeSentiment(other.getSentiment()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }