com.google.cloud.automl.v1.PredictResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-google-cloud-automl-v1 Show documentation
Show all versions of proto-google-cloud-automl-v1 Show documentation
PROTO library for proto-google-cloud-automl-v1
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/automl/v1/prediction_service.proto
// Protobuf Java Version: 3.25.4
package com.google.cloud.automl.v1;
/**
*
*
*
* Response message for [PredictionService.Predict][google.cloud.automl.v1.PredictionService.Predict].
*
*
* Protobuf type {@code google.cloud.automl.v1.PredictResponse}
*/
public final class PredictResponse extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.automl.v1.PredictResponse)
PredictResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use PredictResponse.newBuilder() to construct.
private PredictResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private PredictResponse() {
payload_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new PredictResponse();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.automl.v1.PredictionServiceProto
.internal_static_google_cloud_automl_v1_PredictResponse_descriptor;
}
@SuppressWarnings({"rawtypes"})
@java.lang.Override
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 2:
return internalGetMetadata();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.automl.v1.PredictionServiceProto
.internal_static_google_cloud_automl_v1_PredictResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.automl.v1.PredictResponse.class,
com.google.cloud.automl.v1.PredictResponse.Builder.class);
}
private int bitField0_;
public static final int PAYLOAD_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private java.util.List payload_;
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
@java.lang.Override
public java.util.List getPayloadList() {
return payload_;
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
@java.lang.Override
public java.util.List extends com.google.cloud.automl.v1.AnnotationPayloadOrBuilder>
getPayloadOrBuilderList() {
return payload_;
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
@java.lang.Override
public int getPayloadCount() {
return payload_.size();
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
@java.lang.Override
public com.google.cloud.automl.v1.AnnotationPayload getPayload(int index) {
return payload_.get(index);
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
@java.lang.Override
public com.google.cloud.automl.v1.AnnotationPayloadOrBuilder getPayloadOrBuilder(int index) {
return payload_.get(index);
}
public static final int PREPROCESSED_INPUT_FIELD_NUMBER = 3;
private com.google.cloud.automl.v1.ExamplePayload preprocessedInput_;
/**
*
*
*
* The preprocessed example that AutoML actually makes prediction on.
* Empty if AutoML does not preprocess the input example.
*
* For AutoML Natural Language (Classification, Entity Extraction, and
* Sentiment Analysis), if the input is a document, the recognized text is
* returned in the
* [document_text][google.cloud.automl.v1.Document.document_text]
* property.
*
*
* .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;
*
* @return Whether the preprocessedInput field is set.
*/
@java.lang.Override
public boolean hasPreprocessedInput() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* The preprocessed example that AutoML actually makes prediction on.
* Empty if AutoML does not preprocess the input example.
*
* For AutoML Natural Language (Classification, Entity Extraction, and
* Sentiment Analysis), if the input is a document, the recognized text is
* returned in the
* [document_text][google.cloud.automl.v1.Document.document_text]
* property.
*
*
* .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;
*
* @return The preprocessedInput.
*/
@java.lang.Override
public com.google.cloud.automl.v1.ExamplePayload getPreprocessedInput() {
return preprocessedInput_ == null
? com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance()
: preprocessedInput_;
}
/**
*
*
*
* The preprocessed example that AutoML actually makes prediction on.
* Empty if AutoML does not preprocess the input example.
*
* For AutoML Natural Language (Classification, Entity Extraction, and
* Sentiment Analysis), if the input is a document, the recognized text is
* returned in the
* [document_text][google.cloud.automl.v1.Document.document_text]
* property.
*
*
* .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;
*/
@java.lang.Override
public com.google.cloud.automl.v1.ExamplePayloadOrBuilder getPreprocessedInputOrBuilder() {
return preprocessedInput_ == null
? com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance()
: preprocessedInput_;
}
public static final int METADATA_FIELD_NUMBER = 2;
private static final class MetadataDefaultEntryHolder {
static final com.google.protobuf.MapEntry defaultEntry =
com.google.protobuf.MapEntry.newDefaultInstance(
com.google.cloud.automl.v1.PredictionServiceProto
.internal_static_google_cloud_automl_v1_PredictResponse_MetadataEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.STRING,
"");
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField metadata_;
private com.google.protobuf.MapField internalGetMetadata() {
if (metadata_ == null) {
return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry);
}
return metadata_;
}
public int getMetadataCount() {
return internalGetMetadata().getMap().size();
}
/**
*
*
*
* Additional domain-specific prediction response metadata.
*
* AutoML Vision Object Detection
*
* `max_bounding_box_count`
* : (int64) The maximum number of bounding boxes to return per image.
*
* AutoML Natural Language Sentiment Analysis
*
* `sentiment_score`
* : (float, deprecated) A value between -1 and 1,
* -1 maps to least positive sentiment, while 1 maps to the most positive
* one and the higher the score, the more positive the sentiment in the
* document is. Yet these values are relative to the training data, so
* e.g. if all data was positive then -1 is also positive (though
* the least).
* `sentiment_score` is not the same as "score" and "magnitude"
* from Sentiment Analysis in the Natural Language API.
*
*
* map<string, string> metadata = 2;
*/
@java.lang.Override
public boolean containsMetadata(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetMetadata().getMap().containsKey(key);
}
/** Use {@link #getMetadataMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getMetadata() {
return getMetadataMap();
}
/**
*
*
*
* Additional domain-specific prediction response metadata.
*
* AutoML Vision Object Detection
*
* `max_bounding_box_count`
* : (int64) The maximum number of bounding boxes to return per image.
*
* AutoML Natural Language Sentiment Analysis
*
* `sentiment_score`
* : (float, deprecated) A value between -1 and 1,
* -1 maps to least positive sentiment, while 1 maps to the most positive
* one and the higher the score, the more positive the sentiment in the
* document is. Yet these values are relative to the training data, so
* e.g. if all data was positive then -1 is also positive (though
* the least).
* `sentiment_score` is not the same as "score" and "magnitude"
* from Sentiment Analysis in the Natural Language API.
*
*
* map<string, string> metadata = 2;
*/
@java.lang.Override
public java.util.Map getMetadataMap() {
return internalGetMetadata().getMap();
}
/**
*
*
*
* Additional domain-specific prediction response metadata.
*
* AutoML Vision Object Detection
*
* `max_bounding_box_count`
* : (int64) The maximum number of bounding boxes to return per image.
*
* AutoML Natural Language Sentiment Analysis
*
* `sentiment_score`
* : (float, deprecated) A value between -1 and 1,
* -1 maps to least positive sentiment, while 1 maps to the most positive
* one and the higher the score, the more positive the sentiment in the
* document is. Yet these values are relative to the training data, so
* e.g. if all data was positive then -1 is also positive (though
* the least).
* `sentiment_score` is not the same as "score" and "magnitude"
* from Sentiment Analysis in the Natural Language API.
*
*
* map<string, string> metadata = 2;
*/
@java.lang.Override
public /* nullable */ java.lang.String getMetadataOrDefault(
java.lang.String key,
/* nullable */
java.lang.String defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetMetadata().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
*
*
* Additional domain-specific prediction response metadata.
*
* AutoML Vision Object Detection
*
* `max_bounding_box_count`
* : (int64) The maximum number of bounding boxes to return per image.
*
* AutoML Natural Language Sentiment Analysis
*
* `sentiment_score`
* : (float, deprecated) A value between -1 and 1,
* -1 maps to least positive sentiment, while 1 maps to the most positive
* one and the higher the score, the more positive the sentiment in the
* document is. Yet these values are relative to the training data, so
* e.g. if all data was positive then -1 is also positive (though
* the least).
* `sentiment_score` is not the same as "score" and "magnitude"
* from Sentiment Analysis in the Natural Language API.
*
*
* map<string, string> metadata = 2;
*/
@java.lang.Override
public java.lang.String getMetadataOrThrow(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetMetadata().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
for (int i = 0; i < payload_.size(); i++) {
output.writeMessage(1, payload_.get(i));
}
com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 2);
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(3, getPreprocessedInput());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < payload_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, payload_.get(i));
}
for (java.util.Map.Entry entry :
internalGetMetadata().getMap().entrySet()) {
com.google.protobuf.MapEntry metadata__ =
MetadataDefaultEntryHolder.defaultEntry
.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, metadata__);
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPreprocessedInput());
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.automl.v1.PredictResponse)) {
return super.equals(obj);
}
com.google.cloud.automl.v1.PredictResponse other =
(com.google.cloud.automl.v1.PredictResponse) obj;
if (!getPayloadList().equals(other.getPayloadList())) return false;
if (hasPreprocessedInput() != other.hasPreprocessedInput()) return false;
if (hasPreprocessedInput()) {
if (!getPreprocessedInput().equals(other.getPreprocessedInput())) return false;
}
if (!internalGetMetadata().equals(other.internalGetMetadata())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getPayloadCount() > 0) {
hash = (37 * hash) + PAYLOAD_FIELD_NUMBER;
hash = (53 * hash) + getPayloadList().hashCode();
}
if (hasPreprocessedInput()) {
hash = (37 * hash) + PREPROCESSED_INPUT_FIELD_NUMBER;
hash = (53 * hash) + getPreprocessedInput().hashCode();
}
if (!internalGetMetadata().getMap().isEmpty()) {
hash = (37 * hash) + METADATA_FIELD_NUMBER;
hash = (53 * hash) + internalGetMetadata().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.automl.v1.PredictResponse parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.automl.v1.PredictResponse parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.automl.v1.PredictResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.automl.v1.PredictResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.automl.v1.PredictResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.automl.v1.PredictResponse parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.automl.v1.PredictResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.automl.v1.PredictResponse parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.automl.v1.PredictResponse parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.automl.v1.PredictResponse parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.automl.v1.PredictResponse parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.automl.v1.PredictResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.cloud.automl.v1.PredictResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* Response message for [PredictionService.Predict][google.cloud.automl.v1.PredictionService.Predict].
*
*
* Protobuf type {@code google.cloud.automl.v1.PredictResponse}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.PredictResponse)
com.google.cloud.automl.v1.PredictResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.automl.v1.PredictionServiceProto
.internal_static_google_cloud_automl_v1_PredictResponse_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 2:
return internalGetMetadata();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
int number) {
switch (number) {
case 2:
return internalGetMutableMetadata();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.automl.v1.PredictionServiceProto
.internal_static_google_cloud_automl_v1_PredictResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.automl.v1.PredictResponse.class,
com.google.cloud.automl.v1.PredictResponse.Builder.class);
}
// Construct using com.google.cloud.automl.v1.PredictResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getPayloadFieldBuilder();
getPreprocessedInputFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
if (payloadBuilder_ == null) {
payload_ = java.util.Collections.emptyList();
} else {
payload_ = null;
payloadBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
preprocessedInput_ = null;
if (preprocessedInputBuilder_ != null) {
preprocessedInputBuilder_.dispose();
preprocessedInputBuilder_ = null;
}
internalGetMutableMetadata().clear();
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.automl.v1.PredictionServiceProto
.internal_static_google_cloud_automl_v1_PredictResponse_descriptor;
}
@java.lang.Override
public com.google.cloud.automl.v1.PredictResponse getDefaultInstanceForType() {
return com.google.cloud.automl.v1.PredictResponse.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.automl.v1.PredictResponse build() {
com.google.cloud.automl.v1.PredictResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.automl.v1.PredictResponse buildPartial() {
com.google.cloud.automl.v1.PredictResponse result =
new com.google.cloud.automl.v1.PredictResponse(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(com.google.cloud.automl.v1.PredictResponse result) {
if (payloadBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
payload_ = java.util.Collections.unmodifiableList(payload_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.payload_ = payload_;
} else {
result.payload_ = payloadBuilder_.build();
}
}
private void buildPartial0(com.google.cloud.automl.v1.PredictResponse result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000002) != 0)) {
result.preprocessedInput_ =
preprocessedInputBuilder_ == null
? preprocessedInput_
: preprocessedInputBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.metadata_ = internalGetMetadata();
result.metadata_.makeImmutable();
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.automl.v1.PredictResponse) {
return mergeFrom((com.google.cloud.automl.v1.PredictResponse) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.automl.v1.PredictResponse other) {
if (other == com.google.cloud.automl.v1.PredictResponse.getDefaultInstance()) return this;
if (payloadBuilder_ == null) {
if (!other.payload_.isEmpty()) {
if (payload_.isEmpty()) {
payload_ = other.payload_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensurePayloadIsMutable();
payload_.addAll(other.payload_);
}
onChanged();
}
} else {
if (!other.payload_.isEmpty()) {
if (payloadBuilder_.isEmpty()) {
payloadBuilder_.dispose();
payloadBuilder_ = null;
payload_ = other.payload_;
bitField0_ = (bitField0_ & ~0x00000001);
payloadBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getPayloadFieldBuilder()
: null;
} else {
payloadBuilder_.addAllMessages(other.payload_);
}
}
}
if (other.hasPreprocessedInput()) {
mergePreprocessedInput(other.getPreprocessedInput());
}
internalGetMutableMetadata().mergeFrom(other.internalGetMetadata());
bitField0_ |= 0x00000004;
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
com.google.cloud.automl.v1.AnnotationPayload m =
input.readMessage(
com.google.cloud.automl.v1.AnnotationPayload.parser(), extensionRegistry);
if (payloadBuilder_ == null) {
ensurePayloadIsMutable();
payload_.add(m);
} else {
payloadBuilder_.addMessage(m);
}
break;
} // case 10
case 18:
{
com.google.protobuf.MapEntry metadata__ =
input.readMessage(
MetadataDefaultEntryHolder.defaultEntry.getParserForType(),
extensionRegistry);
internalGetMutableMetadata()
.getMutableMap()
.put(metadata__.getKey(), metadata__.getValue());
bitField0_ |= 0x00000004;
break;
} // case 18
case 26:
{
input.readMessage(
getPreprocessedInputFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 26
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.util.List payload_ =
java.util.Collections.emptyList();
private void ensurePayloadIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
payload_ = new java.util.ArrayList(payload_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.automl.v1.AnnotationPayload,
com.google.cloud.automl.v1.AnnotationPayload.Builder,
com.google.cloud.automl.v1.AnnotationPayloadOrBuilder>
payloadBuilder_;
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public java.util.List getPayloadList() {
if (payloadBuilder_ == null) {
return java.util.Collections.unmodifiableList(payload_);
} else {
return payloadBuilder_.getMessageList();
}
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public int getPayloadCount() {
if (payloadBuilder_ == null) {
return payload_.size();
} else {
return payloadBuilder_.getCount();
}
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public com.google.cloud.automl.v1.AnnotationPayload getPayload(int index) {
if (payloadBuilder_ == null) {
return payload_.get(index);
} else {
return payloadBuilder_.getMessage(index);
}
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public Builder setPayload(int index, com.google.cloud.automl.v1.AnnotationPayload value) {
if (payloadBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePayloadIsMutable();
payload_.set(index, value);
onChanged();
} else {
payloadBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public Builder setPayload(
int index, com.google.cloud.automl.v1.AnnotationPayload.Builder builderForValue) {
if (payloadBuilder_ == null) {
ensurePayloadIsMutable();
payload_.set(index, builderForValue.build());
onChanged();
} else {
payloadBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public Builder addPayload(com.google.cloud.automl.v1.AnnotationPayload value) {
if (payloadBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePayloadIsMutable();
payload_.add(value);
onChanged();
} else {
payloadBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public Builder addPayload(int index, com.google.cloud.automl.v1.AnnotationPayload value) {
if (payloadBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePayloadIsMutable();
payload_.add(index, value);
onChanged();
} else {
payloadBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public Builder addPayload(
com.google.cloud.automl.v1.AnnotationPayload.Builder builderForValue) {
if (payloadBuilder_ == null) {
ensurePayloadIsMutable();
payload_.add(builderForValue.build());
onChanged();
} else {
payloadBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public Builder addPayload(
int index, com.google.cloud.automl.v1.AnnotationPayload.Builder builderForValue) {
if (payloadBuilder_ == null) {
ensurePayloadIsMutable();
payload_.add(index, builderForValue.build());
onChanged();
} else {
payloadBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public Builder addAllPayload(
java.lang.Iterable extends com.google.cloud.automl.v1.AnnotationPayload> values) {
if (payloadBuilder_ == null) {
ensurePayloadIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, payload_);
onChanged();
} else {
payloadBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public Builder clearPayload() {
if (payloadBuilder_ == null) {
payload_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
payloadBuilder_.clear();
}
return this;
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public Builder removePayload(int index) {
if (payloadBuilder_ == null) {
ensurePayloadIsMutable();
payload_.remove(index);
onChanged();
} else {
payloadBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public com.google.cloud.automl.v1.AnnotationPayload.Builder getPayloadBuilder(int index) {
return getPayloadFieldBuilder().getBuilder(index);
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public com.google.cloud.automl.v1.AnnotationPayloadOrBuilder getPayloadOrBuilder(int index) {
if (payloadBuilder_ == null) {
return payload_.get(index);
} else {
return payloadBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public java.util.List extends com.google.cloud.automl.v1.AnnotationPayloadOrBuilder>
getPayloadOrBuilderList() {
if (payloadBuilder_ != null) {
return payloadBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(payload_);
}
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public com.google.cloud.automl.v1.AnnotationPayload.Builder addPayloadBuilder() {
return getPayloadFieldBuilder()
.addBuilder(com.google.cloud.automl.v1.AnnotationPayload.getDefaultInstance());
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public com.google.cloud.automl.v1.AnnotationPayload.Builder addPayloadBuilder(int index) {
return getPayloadFieldBuilder()
.addBuilder(index, com.google.cloud.automl.v1.AnnotationPayload.getDefaultInstance());
}
/**
*
*
*
* Prediction result.
* AutoML Translation and AutoML Natural Language Sentiment Analysis
* return precisely one payload.
*
*
* repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
*/
public java.util.List
getPayloadBuilderList() {
return getPayloadFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.automl.v1.AnnotationPayload,
com.google.cloud.automl.v1.AnnotationPayload.Builder,
com.google.cloud.automl.v1.AnnotationPayloadOrBuilder>
getPayloadFieldBuilder() {
if (payloadBuilder_ == null) {
payloadBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.automl.v1.AnnotationPayload,
com.google.cloud.automl.v1.AnnotationPayload.Builder,
com.google.cloud.automl.v1.AnnotationPayloadOrBuilder>(
payload_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
payload_ = null;
}
return payloadBuilder_;
}
private com.google.cloud.automl.v1.ExamplePayload preprocessedInput_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.automl.v1.ExamplePayload,
com.google.cloud.automl.v1.ExamplePayload.Builder,
com.google.cloud.automl.v1.ExamplePayloadOrBuilder>
preprocessedInputBuilder_;
/**
*
*
*
* The preprocessed example that AutoML actually makes prediction on.
* Empty if AutoML does not preprocess the input example.
*
* For AutoML Natural Language (Classification, Entity Extraction, and
* Sentiment Analysis), if the input is a document, the recognized text is
* returned in the
* [document_text][google.cloud.automl.v1.Document.document_text]
* property.
*
*
* .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;
*
* @return Whether the preprocessedInput field is set.
*/
public boolean hasPreprocessedInput() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
*
*
* The preprocessed example that AutoML actually makes prediction on.
* Empty if AutoML does not preprocess the input example.
*
* For AutoML Natural Language (Classification, Entity Extraction, and
* Sentiment Analysis), if the input is a document, the recognized text is
* returned in the
* [document_text][google.cloud.automl.v1.Document.document_text]
* property.
*
*
* .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;
*
* @return The preprocessedInput.
*/
public com.google.cloud.automl.v1.ExamplePayload getPreprocessedInput() {
if (preprocessedInputBuilder_ == null) {
return preprocessedInput_ == null
? com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance()
: preprocessedInput_;
} else {
return preprocessedInputBuilder_.getMessage();
}
}
/**
*
*
*
* The preprocessed example that AutoML actually makes prediction on.
* Empty if AutoML does not preprocess the input example.
*
* For AutoML Natural Language (Classification, Entity Extraction, and
* Sentiment Analysis), if the input is a document, the recognized text is
* returned in the
* [document_text][google.cloud.automl.v1.Document.document_text]
* property.
*
*
* .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;
*/
public Builder setPreprocessedInput(com.google.cloud.automl.v1.ExamplePayload value) {
if (preprocessedInputBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
preprocessedInput_ = value;
} else {
preprocessedInputBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* The preprocessed example that AutoML actually makes prediction on.
* Empty if AutoML does not preprocess the input example.
*
* For AutoML Natural Language (Classification, Entity Extraction, and
* Sentiment Analysis), if the input is a document, the recognized text is
* returned in the
* [document_text][google.cloud.automl.v1.Document.document_text]
* property.
*
*
* .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;
*/
public Builder setPreprocessedInput(
com.google.cloud.automl.v1.ExamplePayload.Builder builderForValue) {
if (preprocessedInputBuilder_ == null) {
preprocessedInput_ = builderForValue.build();
} else {
preprocessedInputBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* The preprocessed example that AutoML actually makes prediction on.
* Empty if AutoML does not preprocess the input example.
*
* For AutoML Natural Language (Classification, Entity Extraction, and
* Sentiment Analysis), if the input is a document, the recognized text is
* returned in the
* [document_text][google.cloud.automl.v1.Document.document_text]
* property.
*
*
* .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;
*/
public Builder mergePreprocessedInput(com.google.cloud.automl.v1.ExamplePayload value) {
if (preprocessedInputBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)
&& preprocessedInput_ != null
&& preprocessedInput_
!= com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance()) {
getPreprocessedInputBuilder().mergeFrom(value);
} else {
preprocessedInput_ = value;
}
} else {
preprocessedInputBuilder_.mergeFrom(value);
}
if (preprocessedInput_ != null) {
bitField0_ |= 0x00000002;
onChanged();
}
return this;
}
/**
*
*
*
* The preprocessed example that AutoML actually makes prediction on.
* Empty if AutoML does not preprocess the input example.
*
* For AutoML Natural Language (Classification, Entity Extraction, and
* Sentiment Analysis), if the input is a document, the recognized text is
* returned in the
* [document_text][google.cloud.automl.v1.Document.document_text]
* property.
*
*
* .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;
*/
public Builder clearPreprocessedInput() {
bitField0_ = (bitField0_ & ~0x00000002);
preprocessedInput_ = null;
if (preprocessedInputBuilder_ != null) {
preprocessedInputBuilder_.dispose();
preprocessedInputBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* The preprocessed example that AutoML actually makes prediction on.
* Empty if AutoML does not preprocess the input example.
*
* For AutoML Natural Language (Classification, Entity Extraction, and
* Sentiment Analysis), if the input is a document, the recognized text is
* returned in the
* [document_text][google.cloud.automl.v1.Document.document_text]
* property.
*
*
* .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;
*/
public com.google.cloud.automl.v1.ExamplePayload.Builder getPreprocessedInputBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getPreprocessedInputFieldBuilder().getBuilder();
}
/**
*
*
*
* The preprocessed example that AutoML actually makes prediction on.
* Empty if AutoML does not preprocess the input example.
*
* For AutoML Natural Language (Classification, Entity Extraction, and
* Sentiment Analysis), if the input is a document, the recognized text is
* returned in the
* [document_text][google.cloud.automl.v1.Document.document_text]
* property.
*
*
* .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;
*/
public com.google.cloud.automl.v1.ExamplePayloadOrBuilder getPreprocessedInputOrBuilder() {
if (preprocessedInputBuilder_ != null) {
return preprocessedInputBuilder_.getMessageOrBuilder();
} else {
return preprocessedInput_ == null
? com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance()
: preprocessedInput_;
}
}
/**
*
*
*
* The preprocessed example that AutoML actually makes prediction on.
* Empty if AutoML does not preprocess the input example.
*
* For AutoML Natural Language (Classification, Entity Extraction, and
* Sentiment Analysis), if the input is a document, the recognized text is
* returned in the
* [document_text][google.cloud.automl.v1.Document.document_text]
* property.
*
*
* .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.automl.v1.ExamplePayload,
com.google.cloud.automl.v1.ExamplePayload.Builder,
com.google.cloud.automl.v1.ExamplePayloadOrBuilder>
getPreprocessedInputFieldBuilder() {
if (preprocessedInputBuilder_ == null) {
preprocessedInputBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.automl.v1.ExamplePayload,
com.google.cloud.automl.v1.ExamplePayload.Builder,
com.google.cloud.automl.v1.ExamplePayloadOrBuilder>(
getPreprocessedInput(), getParentForChildren(), isClean());
preprocessedInput_ = null;
}
return preprocessedInputBuilder_;
}
private com.google.protobuf.MapField metadata_;
private com.google.protobuf.MapField internalGetMetadata() {
if (metadata_ == null) {
return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry);
}
return metadata_;
}
private com.google.protobuf.MapField
internalGetMutableMetadata() {
if (metadata_ == null) {
metadata_ =
com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry);
}
if (!metadata_.isMutable()) {
metadata_ = metadata_.copy();
}
bitField0_ |= 0x00000004;
onChanged();
return metadata_;
}
public int getMetadataCount() {
return internalGetMetadata().getMap().size();
}
/**
*
*
*
* Additional domain-specific prediction response metadata.
*
* AutoML Vision Object Detection
*
* `max_bounding_box_count`
* : (int64) The maximum number of bounding boxes to return per image.
*
* AutoML Natural Language Sentiment Analysis
*
* `sentiment_score`
* : (float, deprecated) A value between -1 and 1,
* -1 maps to least positive sentiment, while 1 maps to the most positive
* one and the higher the score, the more positive the sentiment in the
* document is. Yet these values are relative to the training data, so
* e.g. if all data was positive then -1 is also positive (though
* the least).
* `sentiment_score` is not the same as "score" and "magnitude"
* from Sentiment Analysis in the Natural Language API.
*
*
* map<string, string> metadata = 2;
*/
@java.lang.Override
public boolean containsMetadata(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetMetadata().getMap().containsKey(key);
}
/** Use {@link #getMetadataMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getMetadata() {
return getMetadataMap();
}
/**
*
*
*
* Additional domain-specific prediction response metadata.
*
* AutoML Vision Object Detection
*
* `max_bounding_box_count`
* : (int64) The maximum number of bounding boxes to return per image.
*
* AutoML Natural Language Sentiment Analysis
*
* `sentiment_score`
* : (float, deprecated) A value between -1 and 1,
* -1 maps to least positive sentiment, while 1 maps to the most positive
* one and the higher the score, the more positive the sentiment in the
* document is. Yet these values are relative to the training data, so
* e.g. if all data was positive then -1 is also positive (though
* the least).
* `sentiment_score` is not the same as "score" and "magnitude"
* from Sentiment Analysis in the Natural Language API.
*
*
* map<string, string> metadata = 2;
*/
@java.lang.Override
public java.util.Map getMetadataMap() {
return internalGetMetadata().getMap();
}
/**
*
*
*
* Additional domain-specific prediction response metadata.
*
* AutoML Vision Object Detection
*
* `max_bounding_box_count`
* : (int64) The maximum number of bounding boxes to return per image.
*
* AutoML Natural Language Sentiment Analysis
*
* `sentiment_score`
* : (float, deprecated) A value between -1 and 1,
* -1 maps to least positive sentiment, while 1 maps to the most positive
* one and the higher the score, the more positive the sentiment in the
* document is. Yet these values are relative to the training data, so
* e.g. if all data was positive then -1 is also positive (though
* the least).
* `sentiment_score` is not the same as "score" and "magnitude"
* from Sentiment Analysis in the Natural Language API.
*
*
* map<string, string> metadata = 2;
*/
@java.lang.Override
public /* nullable */ java.lang.String getMetadataOrDefault(
java.lang.String key,
/* nullable */
java.lang.String defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetMetadata().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
*
*
* Additional domain-specific prediction response metadata.
*
* AutoML Vision Object Detection
*
* `max_bounding_box_count`
* : (int64) The maximum number of bounding boxes to return per image.
*
* AutoML Natural Language Sentiment Analysis
*
* `sentiment_score`
* : (float, deprecated) A value between -1 and 1,
* -1 maps to least positive sentiment, while 1 maps to the most positive
* one and the higher the score, the more positive the sentiment in the
* document is. Yet these values are relative to the training data, so
* e.g. if all data was positive then -1 is also positive (though
* the least).
* `sentiment_score` is not the same as "score" and "magnitude"
* from Sentiment Analysis in the Natural Language API.
*
*
* map<string, string> metadata = 2;
*/
@java.lang.Override
public java.lang.String getMetadataOrThrow(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetMetadata().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public Builder clearMetadata() {
bitField0_ = (bitField0_ & ~0x00000004);
internalGetMutableMetadata().getMutableMap().clear();
return this;
}
/**
*
*
*
* Additional domain-specific prediction response metadata.
*
* AutoML Vision Object Detection
*
* `max_bounding_box_count`
* : (int64) The maximum number of bounding boxes to return per image.
*
* AutoML Natural Language Sentiment Analysis
*
* `sentiment_score`
* : (float, deprecated) A value between -1 and 1,
* -1 maps to least positive sentiment, while 1 maps to the most positive
* one and the higher the score, the more positive the sentiment in the
* document is. Yet these values are relative to the training data, so
* e.g. if all data was positive then -1 is also positive (though
* the least).
* `sentiment_score` is not the same as "score" and "magnitude"
* from Sentiment Analysis in the Natural Language API.
*
*
* map<string, string> metadata = 2;
*/
public Builder removeMetadata(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
internalGetMutableMetadata().getMutableMap().remove(key);
return this;
}
/** Use alternate mutation accessors instead. */
@java.lang.Deprecated
public java.util.Map getMutableMetadata() {
bitField0_ |= 0x00000004;
return internalGetMutableMetadata().getMutableMap();
}
/**
*
*
*
* Additional domain-specific prediction response metadata.
*
* AutoML Vision Object Detection
*
* `max_bounding_box_count`
* : (int64) The maximum number of bounding boxes to return per image.
*
* AutoML Natural Language Sentiment Analysis
*
* `sentiment_score`
* : (float, deprecated) A value between -1 and 1,
* -1 maps to least positive sentiment, while 1 maps to the most positive
* one and the higher the score, the more positive the sentiment in the
* document is. Yet these values are relative to the training data, so
* e.g. if all data was positive then -1 is also positive (though
* the least).
* `sentiment_score` is not the same as "score" and "magnitude"
* from Sentiment Analysis in the Natural Language API.
*
*
* map<string, string> metadata = 2;
*/
public Builder putMetadata(java.lang.String key, java.lang.String value) {
if (key == null) {
throw new NullPointerException("map key");
}
if (value == null) {
throw new NullPointerException("map value");
}
internalGetMutableMetadata().getMutableMap().put(key, value);
bitField0_ |= 0x00000004;
return this;
}
/**
*
*
*
* Additional domain-specific prediction response metadata.
*
* AutoML Vision Object Detection
*
* `max_bounding_box_count`
* : (int64) The maximum number of bounding boxes to return per image.
*
* AutoML Natural Language Sentiment Analysis
*
* `sentiment_score`
* : (float, deprecated) A value between -1 and 1,
* -1 maps to least positive sentiment, while 1 maps to the most positive
* one and the higher the score, the more positive the sentiment in the
* document is. Yet these values are relative to the training data, so
* e.g. if all data was positive then -1 is also positive (though
* the least).
* `sentiment_score` is not the same as "score" and "magnitude"
* from Sentiment Analysis in the Natural Language API.
*
*
* map<string, string> metadata = 2;
*/
public Builder putAllMetadata(java.util.Map values) {
internalGetMutableMetadata().getMutableMap().putAll(values);
bitField0_ |= 0x00000004;
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.PredictResponse)
}
// @@protoc_insertion_point(class_scope:google.cloud.automl.v1.PredictResponse)
private static final com.google.cloud.automl.v1.PredictResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.automl.v1.PredictResponse();
}
public static com.google.cloud.automl.v1.PredictResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public PredictResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.automl.v1.PredictResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}