Class 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.GeneratedMessageV3.Builder<PredictResponse.Builder>
    implements PredictResponseOrBuilder
     Response message for [PredictionService.Predict][google.cloud.automl.v1.PredictionService.Predict].
     
    Protobuf type google.cloud.automl.v1.PredictResponse
    • Method Detail

      • getDescriptor

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

        protected com.google.protobuf.MapField internalGetMapField​(int number)
        Overrides:
        internalGetMapField in class com.google.protobuf.GeneratedMessageV3.Builder<PredictResponse.Builder>
      • internalGetMutableMapField

        protected com.google.protobuf.MapField internalGetMutableMapField​(int number)
        Overrides:
        internalGetMutableMapField in class com.google.protobuf.GeneratedMessageV3.Builder<PredictResponse.Builder>
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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
      • clone

        public PredictResponse.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<PredictResponse.Builder>
      • setField

        public PredictResponse.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<PredictResponse.Builder>
      • clearField

        public PredictResponse.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<PredictResponse.Builder>
      • clearOneof

        public PredictResponse.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<PredictResponse.Builder>
      • setRepeatedField

        public PredictResponse.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                        int index,
                                                        Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<PredictResponse.Builder>
      • addRepeatedField

        public PredictResponse.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                        Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<PredictResponse.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>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.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
      • 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
      • 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
      • 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;
      • setUnknownFields

        public final PredictResponse.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<PredictResponse.Builder>
      • mergeUnknownFields

        public final PredictResponse.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<PredictResponse.Builder>