/** * * * <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.AnalyzeEntitiesRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
/** * Finds named entities (currently proper names and common nouns) in the text along with entity * types, salience, mentions for each entity, and other properties. * * <p>Sample code: * * <pre><code> * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { * Document document = Document.newBuilder().build(); * EncodingType encodingType = EncodingType.NONE; * AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(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 AnalyzeEntitiesResponse analyzeEntities( Document document, EncodingType encodingType) { AnalyzeEntitiesRequest request = AnalyzeEntitiesRequest.newBuilder() .setDocument(document) .setEncodingType(encodingType) .build(); return analyzeEntities(request); }
/** * Finds named entities (currently proper names and common nouns) in the text along with entity * types, salience, mentions for each entity, and other properties. * * <p>Sample code: * * <pre><code> * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { * Document document = Document.newBuilder().build(); * EncodingType encodingType = EncodingType.NONE; * AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(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 AnalyzeEntitiesResponse analyzeEntities( Document document, EncodingType encodingType) { AnalyzeEntitiesRequest request = AnalyzeEntitiesRequest.newBuilder() .setDocument(document) .setEncodingType(encodingType) .build(); return analyzeEntities(request); }
private Builder() { maybeForceBuilderInitialization(); }
public static Builder newBuilder( com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); }
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); }
@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.AnalyzeEntitiesRequest build() { com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest 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.AnalyzeEntitiesRequest) { return mergeFrom((com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest) other); } else { super.mergeFrom(other); return this; } }
public Builder mergeFrom(com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest other) { if (other == com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest.getDefaultInstance()) return this; if (other.hasDocument()) { mergeDocument(other.getDocument()); } if (other.encodingType_ != 0) { setEncodingTypeValue(other.getEncodingTypeValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }