/** * * * <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 aggregate sentiment expressed for this * entity in the provided document. * </pre> * * <code>.google.cloud.language.v1beta2.Sentiment sentiment = 6;</code> */ public Builder setSentiment( com.google.cloud.language.v1beta2.Sentiment.Builder builderForValue) { if (sentimentBuilder_ == null) { sentiment_ = builderForValue.build(); onChanged(); } else { sentimentBuilder_.setMessage(builderForValue.build()); } return this; } /**
com.google.cloud.language.v1beta2.Sentiment.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(documentSentiment_); documentSentiment_ = subBuilder.buildPartial();
com.google.cloud.language.v1beta2.Sentiment.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(sentiment_); sentiment_ = subBuilder.buildPartial();
com.google.cloud.language.v1beta2.Sentiment.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(sentiment_); sentiment_ = subBuilder.buildPartial();
com.google.cloud.language.v1beta2.Sentiment.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(sentiment_); sentiment_ = subBuilder.buildPartial();
com.google.cloud.language.v1beta2.Sentiment.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(documentSentiment_); documentSentiment_ = subBuilder.buildPartial();
/** * * * <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 aggregate sentiment expressed for this * entity in the provided document. * </pre> * * <code>.google.cloud.language.v1beta2.Sentiment sentiment = 6;</code> */ public Builder mergeSentiment(com.google.cloud.language.v1beta2.Sentiment value) { if (sentimentBuilder_ == null) { if (sentiment_ != null) { sentiment_ = com.google.cloud.language.v1beta2.Sentiment.newBuilder(sentiment_) .mergeFrom(value) .buildPartial(); } else { sentiment_ = value; } onChanged(); } else { sentimentBuilder_.mergeFrom(value); } return this; } /**
/** * * * <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 Builder mergeSentiment(com.google.cloud.language.v1beta2.Sentiment value) { if (sentimentBuilder_ == null) { if (sentiment_ != null) { sentiment_ = com.google.cloud.language.v1beta2.Sentiment.newBuilder(sentiment_) .mergeFrom(value) .buildPartial(); } else { sentiment_ = value; } onChanged(); } else { sentimentBuilder_.mergeFrom(value); } return this; } /**
/** * * * <pre> * The overall sentiment of the input document. * </pre> * * <code>.google.cloud.language.v1beta2.Sentiment document_sentiment = 1;</code> */ public Builder mergeDocumentSentiment(com.google.cloud.language.v1beta2.Sentiment value) { if (documentSentimentBuilder_ == null) { if (documentSentiment_ != null) { documentSentiment_ = com.google.cloud.language.v1beta2.Sentiment.newBuilder(documentSentiment_) .mergeFrom(value) .buildPartial(); } else { documentSentiment_ = value; } onChanged(); } else { documentSentimentBuilder_.mergeFrom(value); } return this; } /**
/** * * * <pre> * For calls to [AnalyzeSentiment][] or if * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] is set to * true, this field will contain the sentiment for the sentence. * </pre> * * <code>.google.cloud.language.v1beta2.Sentiment sentiment = 2;</code> */ public Builder mergeSentiment(com.google.cloud.language.v1beta2.Sentiment value) { if (sentimentBuilder_ == null) { if (sentiment_ != null) { sentiment_ = com.google.cloud.language.v1beta2.Sentiment.newBuilder(sentiment_) .mergeFrom(value) .buildPartial(); } else { sentiment_ = value; } onChanged(); } else { sentimentBuilder_.mergeFrom(value); } return this; } /**
/** * * * <pre> * The overall sentiment for the document. Populated if the user enables * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment]. * </pre> * * <code>.google.cloud.language.v1beta2.Sentiment document_sentiment = 4;</code> */ public Builder mergeDocumentSentiment(com.google.cloud.language.v1beta2.Sentiment value) { if (documentSentimentBuilder_ == null) { if (documentSentiment_ != null) { documentSentiment_ = com.google.cloud.language.v1beta2.Sentiment.newBuilder(documentSentiment_) .mergeFrom(value) .buildPartial(); } else { documentSentiment_ = value; } onChanged(); } else { documentSentimentBuilder_.mergeFrom(value); } return this; } /**
/** * * * <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 Builder setSentiment( com.google.cloud.language.v1beta2.Sentiment.Builder builderForValue) { if (sentimentBuilder_ == null) { sentiment_ = builderForValue.build(); onChanged(); } else { sentimentBuilder_.setMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * For calls to [AnalyzeSentiment][] or if * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] is set to * true, this field will contain the sentiment for the sentence. * </pre> * * <code>.google.cloud.language.v1beta2.Sentiment sentiment = 2;</code> */ public Builder setSentiment( com.google.cloud.language.v1beta2.Sentiment.Builder builderForValue) { if (sentimentBuilder_ == null) { sentiment_ = builderForValue.build(); onChanged(); } else { sentimentBuilder_.setMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * The overall sentiment for the document. Populated if the user enables * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment]. * </pre> * * <code>.google.cloud.language.v1beta2.Sentiment document_sentiment = 4;</code> */ public Builder setDocumentSentiment( com.google.cloud.language.v1beta2.Sentiment.Builder builderForValue) { if (documentSentimentBuilder_ == null) { documentSentiment_ = builderForValue.build(); onChanged(); } else { documentSentimentBuilder_.setMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * The overall sentiment of the input document. * </pre> * * <code>.google.cloud.language.v1beta2.Sentiment document_sentiment = 1;</code> */ public Builder setDocumentSentiment( com.google.cloud.language.v1beta2.Sentiment.Builder builderForValue) { if (documentSentimentBuilder_ == null) { documentSentiment_ = builderForValue.build(); onChanged(); } else { documentSentimentBuilder_.setMessage(builderForValue.build()); } return this; } /**
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.cloud.language.v1beta2.Sentiment parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.cloud.language.v1beta2.Sentiment) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
/** * * * <pre> * Sentiment score between -1.0 (negative sentiment) and 1.0 * (positive sentiment). * </pre> * * <code>float score = 3;</code> */ public Builder setScore(float value) { score_ = value; onChanged(); return this; } /**
/** * * * <pre> * A non-negative number in the [0, +inf) range, which represents * the absolute magnitude of sentiment regardless of score (positive or * negative). * </pre> * * <code>float magnitude = 2;</code> */ public Builder clearMagnitude() { magnitude_ = 0F; onChanged(); return this; }
/** * * * <pre> * A non-negative number in the [0, +inf) range, which represents * the absolute magnitude of sentiment regardless of score (positive or * negative). * </pre> * * <code>float magnitude = 2;</code> */ public Builder setMagnitude(float value) { magnitude_ = value; onChanged(); return this; } /**
/** * * * <pre> * Sentiment score between -1.0 (negative sentiment) and 1.0 * (positive sentiment). * </pre> * * <code>float score = 3;</code> */ public Builder clearScore() { score_ = 0F; onChanged(); return this; }