/** * * * <pre> * Input document. * </pre> * * <code>.google.cloud.language.v1beta2.Document document = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.language.v1beta2.Document, com.google.cloud.language.v1beta2.Document.Builder, com.google.cloud.language.v1beta2.DocumentOrBuilder> getDocumentFieldBuilder() { if (documentBuilder_ == null) { documentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.language.v1beta2.Document, com.google.cloud.language.v1beta2.Document.Builder, com.google.cloud.language.v1beta2.DocumentOrBuilder>( getDocument(), getParentForChildren(), isClean()); document_ = null; } return documentBuilder_; }
/** * * * <pre> * Input document. * </pre> * * <code>.google.cloud.language.v1beta2.Document document = 1;</code> */ public com.google.cloud.language.v1beta2.Document.Builder getDocumentBuilder() { onChanged(); return getDocumentFieldBuilder().getBuilder(); } /**
@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.AnalyzeEntitySentimentRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
/** * Finds entities, similar to * [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text * and analyzes sentiment associated with each entity and its mentions. * * <p>Sample code: * * <pre><code> * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { * Document document = Document.newBuilder().build(); * EncodingType encodingType = EncodingType.NONE; * AnalyzeEntitySentimentResponse response = languageServiceClient.analyzeEntitySentiment(document, encodingType); * } * </code></pre> * * @param document Input document. * @param encodingType The encoding type used by the API to calculate offsets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment( Document document, EncodingType encodingType) { AnalyzeEntitySentimentRequest request = AnalyzeEntitySentimentRequest.newBuilder() .setDocument(document) .setEncodingType(encodingType) .build(); return analyzeEntitySentiment(request); }
/** * Finds entities, similar to * [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text * and analyzes sentiment associated with each entity and its mentions. * * <p>Sample code: * * <pre><code> * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { * Document document = Document.newBuilder().build(); * EncodingType encodingType = EncodingType.NONE; * AnalyzeEntitySentimentResponse response = languageServiceClient.analyzeEntitySentiment(document, encodingType); * } * </code></pre> * * @param document Input document. * @param encodingType The encoding type used by the API to calculate offsets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment( Document document, EncodingType encodingType) { AnalyzeEntitySentimentRequest request = AnalyzeEntitySentimentRequest.newBuilder() .setDocument(document) .setEncodingType(encodingType) .build(); return analyzeEntitySentiment(request); }
private Builder() { maybeForceBuilderInitialization(); }
public Builder mergeFrom( com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest other) { if (other == com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest.getDefaultInstance()) return this; if (other.hasDocument()) { mergeDocument(other.getDocument()); } if (other.encodingType_ != 0) { setEncodingTypeValue(other.getEncodingTypeValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); }
public static Builder newBuilder( com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); }
@java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
@java.lang.Override public com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest build() { com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest) { return mergeFrom((com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest) other); } else { super.mergeFrom(other); return this; } }