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 predict method.
     
    Protobuf type google.cloud.retail.v2alpha.PredictResponse
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • 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
      • getResultsCount

        public int getResultsCount()
         A list of recommended products. The order represents the ranking (from the
         most relevant product to the least).
         
        repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1;
        Specified by:
        getResultsCount in interface PredictResponseOrBuilder
      • getResults

        public PredictResponse.PredictionResult getResults​(int index)
         A list of recommended products. The order represents the ranking (from the
         most relevant product to the least).
         
        repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1;
        Specified by:
        getResults in interface PredictResponseOrBuilder
      • setResults

        public PredictResponse.Builder setResults​(int index,
                                                  PredictResponse.PredictionResult value)
         A list of recommended products. The order represents the ranking (from the
         most relevant product to the least).
         
        repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1;
      • setResults

        public PredictResponse.Builder setResults​(int index,
                                                  PredictResponse.PredictionResult.Builder builderForValue)
         A list of recommended products. The order represents the ranking (from the
         most relevant product to the least).
         
        repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1;
      • addResults

        public PredictResponse.Builder addResults​(PredictResponse.PredictionResult value)
         A list of recommended products. The order represents the ranking (from the
         most relevant product to the least).
         
        repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1;
      • addResults

        public PredictResponse.Builder addResults​(int index,
                                                  PredictResponse.PredictionResult value)
         A list of recommended products. The order represents the ranking (from the
         most relevant product to the least).
         
        repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1;
      • addResults

        public PredictResponse.Builder addResults​(int index,
                                                  PredictResponse.PredictionResult.Builder builderForValue)
         A list of recommended products. The order represents the ranking (from the
         most relevant product to the least).
         
        repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1;
      • addAllResults

        public PredictResponse.Builder addAllResults​(Iterable<? extends PredictResponse.PredictionResult> values)
         A list of recommended products. The order represents the ranking (from the
         most relevant product to the least).
         
        repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1;
      • clearResults

        public PredictResponse.Builder clearResults()
         A list of recommended products. The order represents the ranking (from the
         most relevant product to the least).
         
        repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1;
      • removeResults

        public PredictResponse.Builder removeResults​(int index)
         A list of recommended products. The order represents the ranking (from the
         most relevant product to the least).
         
        repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1;
      • getResultsBuilder

        public PredictResponse.PredictionResult.Builder getResultsBuilder​(int index)
         A list of recommended products. The order represents the ranking (from the
         most relevant product to the least).
         
        repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1;
      • addResultsBuilder

        public PredictResponse.PredictionResult.Builder addResultsBuilder()
         A list of recommended products. The order represents the ranking (from the
         most relevant product to the least).
         
        repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1;
      • addResultsBuilder

        public PredictResponse.PredictionResult.Builder addResultsBuilder​(int index)
         A list of recommended products. The order represents the ranking (from the
         most relevant product to the least).
         
        repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1;
      • getResultsBuilderList

        public List<PredictResponse.PredictionResult.Builder> getResultsBuilderList()
         A list of recommended products. The order represents the ranking (from the
         most relevant product to the least).
         
        repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1;
      • getAttributionToken

        public String getAttributionToken()
         A unique attribution token. This should be included in the
         [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
         recommendation, which enables accurate attribution of recommendation model
         performance.
         
        string attribution_token = 2;
        Specified by:
        getAttributionToken in interface PredictResponseOrBuilder
        Returns:
        The attributionToken.
      • getAttributionTokenBytes

        public com.google.protobuf.ByteString getAttributionTokenBytes()
         A unique attribution token. This should be included in the
         [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
         recommendation, which enables accurate attribution of recommendation model
         performance.
         
        string attribution_token = 2;
        Specified by:
        getAttributionTokenBytes in interface PredictResponseOrBuilder
        Returns:
        The bytes for attributionToken.
      • setAttributionToken

        public PredictResponse.Builder setAttributionToken​(String value)
         A unique attribution token. This should be included in the
         [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
         recommendation, which enables accurate attribution of recommendation model
         performance.
         
        string attribution_token = 2;
        Parameters:
        value - The attributionToken to set.
        Returns:
        This builder for chaining.
      • clearAttributionToken

        public PredictResponse.Builder clearAttributionToken()
         A unique attribution token. This should be included in the
         [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
         recommendation, which enables accurate attribution of recommendation model
         performance.
         
        string attribution_token = 2;
        Returns:
        This builder for chaining.
      • setAttributionTokenBytes

        public PredictResponse.Builder setAttributionTokenBytes​(com.google.protobuf.ByteString value)
         A unique attribution token. This should be included in the
         [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
         recommendation, which enables accurate attribution of recommendation model
         performance.
         
        string attribution_token = 2;
        Parameters:
        value - The bytes for attributionToken to set.
        Returns:
        This builder for chaining.
      • getMissingIdsList

        public com.google.protobuf.ProtocolStringList getMissingIdsList()
         IDs of products in the request that were missing from the inventory.
         
        repeated string missing_ids = 3;
        Specified by:
        getMissingIdsList in interface PredictResponseOrBuilder
        Returns:
        A list containing the missingIds.
      • getMissingIdsCount

        public int getMissingIdsCount()
         IDs of products in the request that were missing from the inventory.
         
        repeated string missing_ids = 3;
        Specified by:
        getMissingIdsCount in interface PredictResponseOrBuilder
        Returns:
        The count of missingIds.
      • getMissingIds

        public String getMissingIds​(int index)
         IDs of products in the request that were missing from the inventory.
         
        repeated string missing_ids = 3;
        Specified by:
        getMissingIds in interface PredictResponseOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The missingIds at the given index.
      • getMissingIdsBytes

        public com.google.protobuf.ByteString getMissingIdsBytes​(int index)
         IDs of products in the request that were missing from the inventory.
         
        repeated string missing_ids = 3;
        Specified by:
        getMissingIdsBytes in interface PredictResponseOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the missingIds at the given index.
      • setMissingIds

        public PredictResponse.Builder setMissingIds​(int index,
                                                     String value)
         IDs of products in the request that were missing from the inventory.
         
        repeated string missing_ids = 3;
        Parameters:
        index - The index to set the value at.
        value - The missingIds to set.
        Returns:
        This builder for chaining.
      • addMissingIds

        public PredictResponse.Builder addMissingIds​(String value)
         IDs of products in the request that were missing from the inventory.
         
        repeated string missing_ids = 3;
        Parameters:
        value - The missingIds to add.
        Returns:
        This builder for chaining.
      • addAllMissingIds

        public PredictResponse.Builder addAllMissingIds​(Iterable<String> values)
         IDs of products in the request that were missing from the inventory.
         
        repeated string missing_ids = 3;
        Parameters:
        values - The missingIds to add.
        Returns:
        This builder for chaining.
      • clearMissingIds

        public PredictResponse.Builder clearMissingIds()
         IDs of products in the request that were missing from the inventory.
         
        repeated string missing_ids = 3;
        Returns:
        This builder for chaining.
      • addMissingIdsBytes

        public PredictResponse.Builder addMissingIdsBytes​(com.google.protobuf.ByteString value)
         IDs of products in the request that were missing from the inventory.
         
        repeated string missing_ids = 3;
        Parameters:
        value - The bytes of the missingIds to add.
        Returns:
        This builder for chaining.
      • getValidateOnly

        public boolean getValidateOnly()
         True if the validateOnly property was set in the request.
         
        bool validate_only = 4;
        Specified by:
        getValidateOnly in interface PredictResponseOrBuilder
        Returns:
        The validateOnly.
      • setValidateOnly

        public PredictResponse.Builder setValidateOnly​(boolean value)
         True if the validateOnly property was set in the request.
         
        bool validate_only = 4;
        Parameters:
        value - The validateOnly to set.
        Returns:
        This builder for chaining.
      • clearValidateOnly

        public PredictResponse.Builder clearValidateOnly()
         True if the validateOnly property was set in the request.
         
        bool validate_only = 4;
        Returns:
        This builder for chaining.
      • 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>