Class PredictResponse.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<PredictResponse.Builder>
com.google.cloud.automl.v1.PredictResponse.Builder
All Implemented Interfaces:
PredictResponseOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
PredictResponse

public static final class PredictResponse.Builder extends com.google.protobuf.GeneratedMessage.Builder<PredictResponse.Builder> implements PredictResponseOrBuilder
 Response message for [PredictionService.Predict][google.cloud.automl.v1.PredictionService.Predict].
 
Protobuf type google.cloud.automl.v1.PredictResponse
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<PredictResponse.Builder>
    • internalGetMutableMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
      Overrides:
      internalGetMutableMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<PredictResponse.Builder>
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<PredictResponse.Builder>
    • clear

      public PredictResponse.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<PredictResponse.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<PredictResponse.Builder>
    • getDefaultInstanceForType

      public PredictResponse getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public PredictResponse build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public PredictResponse buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public PredictResponse.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<PredictResponse.Builder>
    • mergeFrom

      public PredictResponse.Builder mergeFrom(PredictResponse other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<PredictResponse.Builder>
    • mergeFrom

      public PredictResponse.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<PredictResponse.Builder>
      Throws:
      IOException
    • getPayloadList

      public List<AnnotationPayload> getPayloadList()
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
      Specified by:
      getPayloadList in interface PredictResponseOrBuilder
    • getPayloadCount

      public int getPayloadCount()
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
      Specified by:
      getPayloadCount in interface PredictResponseOrBuilder
    • getPayload

      public AnnotationPayload getPayload(int index)
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
      Specified by:
      getPayload in interface PredictResponseOrBuilder
    • setPayload

      public PredictResponse.Builder setPayload(int index, AnnotationPayload value)
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
    • setPayload

      public PredictResponse.Builder setPayload(int index, AnnotationPayload.Builder builderForValue)
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
    • addPayload

      public PredictResponse.Builder addPayload(AnnotationPayload value)
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
    • addPayload

      public PredictResponse.Builder addPayload(int index, AnnotationPayload value)
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
    • addPayload

      public PredictResponse.Builder addPayload(AnnotationPayload.Builder builderForValue)
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
    • addPayload

      public PredictResponse.Builder addPayload(int index, AnnotationPayload.Builder builderForValue)
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
    • addAllPayload

      public PredictResponse.Builder addAllPayload(Iterable<? extends AnnotationPayload> values)
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
    • clearPayload

      public PredictResponse.Builder clearPayload()
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
    • removePayload

      public PredictResponse.Builder removePayload(int index)
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
    • getPayloadBuilder

      public AnnotationPayload.Builder getPayloadBuilder(int index)
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
    • getPayloadOrBuilder

      public AnnotationPayloadOrBuilder getPayloadOrBuilder(int index)
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
      Specified by:
      getPayloadOrBuilder in interface PredictResponseOrBuilder
    • getPayloadOrBuilderList

      public List<? extends AnnotationPayloadOrBuilder> getPayloadOrBuilderList()
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
      Specified by:
      getPayloadOrBuilderList in interface PredictResponseOrBuilder
    • addPayloadBuilder

      public AnnotationPayload.Builder addPayloadBuilder()
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
    • addPayloadBuilder

      public AnnotationPayload.Builder addPayloadBuilder(int index)
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
    • getPayloadBuilderList

      public List<AnnotationPayload.Builder> getPayloadBuilderList()
       Prediction result.
       AutoML Translation and AutoML Natural Language Sentiment Analysis
       return precisely one payload.
       
      repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;
    • hasPreprocessedInput

      public boolean hasPreprocessedInput()
       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;
      Specified by:
      hasPreprocessedInput in interface PredictResponseOrBuilder
      Returns:
      Whether the preprocessedInput field is set.
    • getPreprocessedInput

      public ExamplePayload getPreprocessedInput()
       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;
      Specified by:
      getPreprocessedInput in interface PredictResponseOrBuilder
      Returns:
      The preprocessedInput.
    • setPreprocessedInput

      public PredictResponse.Builder setPreprocessedInput(ExamplePayload value)
       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;
    • setPreprocessedInput

      public PredictResponse.Builder setPreprocessedInput(ExamplePayload.Builder builderForValue)
       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;
    • mergePreprocessedInput

      public PredictResponse.Builder mergePreprocessedInput(ExamplePayload value)
       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;
    • clearPreprocessedInput

      public PredictResponse.Builder clearPreprocessedInput()
       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;
    • getPreprocessedInputBuilder

      public ExamplePayload.Builder getPreprocessedInputBuilder()
       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;
    • getPreprocessedInputOrBuilder

      public ExamplePayloadOrBuilder getPreprocessedInputOrBuilder()
       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;
      Specified by:
      getPreprocessedInputOrBuilder in interface PredictResponseOrBuilder
    • getMetadataCount

      public int getMetadataCount()
      Description copied from interface: PredictResponseOrBuilder
       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;
      Specified by:
      getMetadataCount in interface PredictResponseOrBuilder
    • containsMetadata

      public boolean containsMetadata(String key)
       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;
      Specified by:
      containsMetadata in interface PredictResponseOrBuilder
    • getMetadata

      @Deprecated public Map<String,String> getMetadata()
      Deprecated.
      Use getMetadataMap() instead.
      Specified by:
      getMetadata in interface PredictResponseOrBuilder
    • getMetadataMap

      public Map<String,String> 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;
      Specified by:
      getMetadataMap in interface PredictResponseOrBuilder
    • getMetadataOrDefault

      public String getMetadataOrDefault(String key, String 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;
      Specified by:
      getMetadataOrDefault in interface PredictResponseOrBuilder
    • getMetadataOrThrow

      public String getMetadataOrThrow(String key)
       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;
      Specified by:
      getMetadataOrThrow in interface PredictResponseOrBuilder
    • clearMetadata

      public PredictResponse.Builder clearMetadata()
    • removeMetadata

      public PredictResponse.Builder removeMetadata(String key)
       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;
    • getMutableMetadata

      @Deprecated public Map<String,String> getMutableMetadata()
      Deprecated.
      Use alternate mutation accessors instead.
    • putMetadata

      public PredictResponse.Builder putMetadata(String key, String value)
       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;
    • putAllMetadata

      public PredictResponse.Builder putAllMetadata(Map<String,String> values)
       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;