Class PredictResponse.PredictionResult.Builder

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

public static final class PredictResponse.PredictionResult.Builder extends com.google.protobuf.GeneratedMessage.Builder<PredictResponse.PredictionResult.Builder> implements PredictResponse.PredictionResultOrBuilder
 PredictionResult represents the recommendation prediction results.
 
Protobuf type google.cloud.retail.v2alpha.PredictResponse.PredictionResult
  • 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.PredictionResult.Builder>
    • internalGetMutableMapFieldReflection

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

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<PredictResponse.PredictionResult.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.PredictionResult.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.PredictionResult.Builder>
    • getDefaultInstanceForType

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

      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

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

      public PredictResponse.PredictionResult.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.PredictionResult.Builder>
    • mergeFrom

    • isInitialized

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

      public PredictResponse.PredictionResult.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.PredictionResult.Builder>
      Throws:
      IOException
    • getId

      public String getId()
       ID of the recommended product
       
      string id = 1;
      Specified by:
      getId in interface PredictResponse.PredictionResultOrBuilder
      Returns:
      The id.
    • getIdBytes

      public com.google.protobuf.ByteString getIdBytes()
       ID of the recommended product
       
      string id = 1;
      Specified by:
      getIdBytes in interface PredictResponse.PredictionResultOrBuilder
      Returns:
      The bytes for id.
    • setId

       ID of the recommended product
       
      string id = 1;
      Parameters:
      value - The id to set.
      Returns:
      This builder for chaining.
    • clearId

       ID of the recommended product
       
      string id = 1;
      Returns:
      This builder for chaining.
    • setIdBytes

      public PredictResponse.PredictionResult.Builder setIdBytes(com.google.protobuf.ByteString value)
       ID of the recommended product
       
      string id = 1;
      Parameters:
      value - The bytes for id to set.
      Returns:
      This builder for chaining.
    • getMetadataCount

      public int getMetadataCount()
      Description copied from interface: PredictResponse.PredictionResultOrBuilder
       Additional product metadata / annotations.
      
       Possible values:
      
       * `product`: JSON representation of the product. Is set if
       `returnProduct` is set to true in `PredictRequest.params`.
       * `score`: Prediction score in double value. Is set if
       `returnScore` is set to true in `PredictRequest.params`.
       
      map<string, .google.protobuf.Value> metadata = 2;
      Specified by:
      getMetadataCount in interface PredictResponse.PredictionResultOrBuilder
    • containsMetadata

      public boolean containsMetadata(String key)
       Additional product metadata / annotations.
      
       Possible values:
      
       * `product`: JSON representation of the product. Is set if
       `returnProduct` is set to true in `PredictRequest.params`.
       * `score`: Prediction score in double value. Is set if
       `returnScore` is set to true in `PredictRequest.params`.
       
      map<string, .google.protobuf.Value> metadata = 2;
      Specified by:
      containsMetadata in interface PredictResponse.PredictionResultOrBuilder
    • getMetadata

      @Deprecated public Map<String,com.google.protobuf.Value> getMetadata()
      Deprecated.
      Use getMetadataMap() instead.
      Specified by:
      getMetadata in interface PredictResponse.PredictionResultOrBuilder
    • getMetadataMap

      public Map<String,com.google.protobuf.Value> getMetadataMap()
       Additional product metadata / annotations.
      
       Possible values:
      
       * `product`: JSON representation of the product. Is set if
       `returnProduct` is set to true in `PredictRequest.params`.
       * `score`: Prediction score in double value. Is set if
       `returnScore` is set to true in `PredictRequest.params`.
       
      map<string, .google.protobuf.Value> metadata = 2;
      Specified by:
      getMetadataMap in interface PredictResponse.PredictionResultOrBuilder
    • getMetadataOrDefault

      public com.google.protobuf.Value getMetadataOrDefault(String key, com.google.protobuf.Value defaultValue)
       Additional product metadata / annotations.
      
       Possible values:
      
       * `product`: JSON representation of the product. Is set if
       `returnProduct` is set to true in `PredictRequest.params`.
       * `score`: Prediction score in double value. Is set if
       `returnScore` is set to true in `PredictRequest.params`.
       
      map<string, .google.protobuf.Value> metadata = 2;
      Specified by:
      getMetadataOrDefault in interface PredictResponse.PredictionResultOrBuilder
    • getMetadataOrThrow

      public com.google.protobuf.Value getMetadataOrThrow(String key)
       Additional product metadata / annotations.
      
       Possible values:
      
       * `product`: JSON representation of the product. Is set if
       `returnProduct` is set to true in `PredictRequest.params`.
       * `score`: Prediction score in double value. Is set if
       `returnScore` is set to true in `PredictRequest.params`.
       
      map<string, .google.protobuf.Value> metadata = 2;
      Specified by:
      getMetadataOrThrow in interface PredictResponse.PredictionResultOrBuilder
    • clearMetadata

    • removeMetadata

      public PredictResponse.PredictionResult.Builder removeMetadata(String key)
       Additional product metadata / annotations.
      
       Possible values:
      
       * `product`: JSON representation of the product. Is set if
       `returnProduct` is set to true in `PredictRequest.params`.
       * `score`: Prediction score in double value. Is set if
       `returnScore` is set to true in `PredictRequest.params`.
       
      map<string, .google.protobuf.Value> metadata = 2;
    • getMutableMetadata

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

      public PredictResponse.PredictionResult.Builder putMetadata(String key, com.google.protobuf.Value value)
       Additional product metadata / annotations.
      
       Possible values:
      
       * `product`: JSON representation of the product. Is set if
       `returnProduct` is set to true in `PredictRequest.params`.
       * `score`: Prediction score in double value. Is set if
       `returnScore` is set to true in `PredictRequest.params`.
       
      map<string, .google.protobuf.Value> metadata = 2;
    • putAllMetadata

      public PredictResponse.PredictionResult.Builder putAllMetadata(Map<String,com.google.protobuf.Value> values)
       Additional product metadata / annotations.
      
       Possible values:
      
       * `product`: JSON representation of the product. Is set if
       `returnProduct` is set to true in `PredictRequest.params`.
       * `score`: Prediction score in double value. Is set if
       `returnScore` is set to true in `PredictRequest.params`.
       
      map<string, .google.protobuf.Value> metadata = 2;
    • putMetadataBuilderIfAbsent

      public com.google.protobuf.Value.Builder putMetadataBuilderIfAbsent(String key)
       Additional product metadata / annotations.
      
       Possible values:
      
       * `product`: JSON representation of the product. Is set if
       `returnProduct` is set to true in `PredictRequest.params`.
       * `score`: Prediction score in double value. Is set if
       `returnScore` is set to true in `PredictRequest.params`.
       
      map<string, .google.protobuf.Value> metadata = 2;