Class FeatureMap.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<FeatureMap.Builder>
com.google.cloud.recommendationengine.v1beta1.FeatureMap.Builder
All Implemented Interfaces:
FeatureMapOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
FeatureMap

public static final class FeatureMap.Builder extends com.google.protobuf.GeneratedMessage.Builder<FeatureMap.Builder> implements FeatureMapOrBuilder
 FeatureMap represents extra features that customers want to include in the
 recommendation model for catalogs/user events as categorical/numerical
 features.
 
Protobuf type google.cloud.recommendationengine.v1beta1.FeatureMap
  • 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<FeatureMap.Builder>
    • internalGetMutableMapFieldReflection

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

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

      public FeatureMap.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<FeatureMap.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<FeatureMap.Builder>
    • getDefaultInstanceForType

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

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

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

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

      public FeatureMap.Builder mergeFrom(FeatureMap other)
    • isInitialized

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

      public FeatureMap.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<FeatureMap.Builder>
      Throws:
      IOException
    • getCategoricalFeaturesCount

      public int getCategoricalFeaturesCount()
      Description copied from interface: FeatureMapOrBuilder
       Categorical features that can take on one of a limited number of possible
       values. Some examples would be the brand/maker of a product, or country of
       a customer.
      
       Feature names and values must be UTF-8 encoded strings.
      
       For example: `{ "colors": {"value": ["yellow", "green"]},
       "sizes": {"value":["S", "M"]}`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;
      Specified by:
      getCategoricalFeaturesCount in interface FeatureMapOrBuilder
    • containsCategoricalFeatures

      public boolean containsCategoricalFeatures(String key)
       Categorical features that can take on one of a limited number of possible
       values. Some examples would be the brand/maker of a product, or country of
       a customer.
      
       Feature names and values must be UTF-8 encoded strings.
      
       For example: `{ "colors": {"value": ["yellow", "green"]},
       "sizes": {"value":["S", "M"]}`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;
      Specified by:
      containsCategoricalFeatures in interface FeatureMapOrBuilder
    • getCategoricalFeatures

      @Deprecated public Map<String,FeatureMap.StringList> getCategoricalFeatures()
      Deprecated.
      Specified by:
      getCategoricalFeatures in interface FeatureMapOrBuilder
    • getCategoricalFeaturesMap

      public Map<String,FeatureMap.StringList> getCategoricalFeaturesMap()
       Categorical features that can take on one of a limited number of possible
       values. Some examples would be the brand/maker of a product, or country of
       a customer.
      
       Feature names and values must be UTF-8 encoded strings.
      
       For example: `{ "colors": {"value": ["yellow", "green"]},
       "sizes": {"value":["S", "M"]}`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;
      Specified by:
      getCategoricalFeaturesMap in interface FeatureMapOrBuilder
    • getCategoricalFeaturesOrDefault

      public FeatureMap.StringList getCategoricalFeaturesOrDefault(String key, FeatureMap.StringList defaultValue)
       Categorical features that can take on one of a limited number of possible
       values. Some examples would be the brand/maker of a product, or country of
       a customer.
      
       Feature names and values must be UTF-8 encoded strings.
      
       For example: `{ "colors": {"value": ["yellow", "green"]},
       "sizes": {"value":["S", "M"]}`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;
      Specified by:
      getCategoricalFeaturesOrDefault in interface FeatureMapOrBuilder
    • getCategoricalFeaturesOrThrow

      public FeatureMap.StringList getCategoricalFeaturesOrThrow(String key)
       Categorical features that can take on one of a limited number of possible
       values. Some examples would be the brand/maker of a product, or country of
       a customer.
      
       Feature names and values must be UTF-8 encoded strings.
      
       For example: `{ "colors": {"value": ["yellow", "green"]},
       "sizes": {"value":["S", "M"]}`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;
      Specified by:
      getCategoricalFeaturesOrThrow in interface FeatureMapOrBuilder
    • clearCategoricalFeatures

      public FeatureMap.Builder clearCategoricalFeatures()
    • removeCategoricalFeatures

      public FeatureMap.Builder removeCategoricalFeatures(String key)
       Categorical features that can take on one of a limited number of possible
       values. Some examples would be the brand/maker of a product, or country of
       a customer.
      
       Feature names and values must be UTF-8 encoded strings.
      
       For example: `{ "colors": {"value": ["yellow", "green"]},
       "sizes": {"value":["S", "M"]}`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;
    • getMutableCategoricalFeatures

      @Deprecated public Map<String,FeatureMap.StringList> getMutableCategoricalFeatures()
      Deprecated.
      Use alternate mutation accessors instead.
    • putCategoricalFeatures

      public FeatureMap.Builder putCategoricalFeatures(String key, FeatureMap.StringList value)
       Categorical features that can take on one of a limited number of possible
       values. Some examples would be the brand/maker of a product, or country of
       a customer.
      
       Feature names and values must be UTF-8 encoded strings.
      
       For example: `{ "colors": {"value": ["yellow", "green"]},
       "sizes": {"value":["S", "M"]}`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;
    • putAllCategoricalFeatures

      public FeatureMap.Builder putAllCategoricalFeatures(Map<String,FeatureMap.StringList> values)
       Categorical features that can take on one of a limited number of possible
       values. Some examples would be the brand/maker of a product, or country of
       a customer.
      
       Feature names and values must be UTF-8 encoded strings.
      
       For example: `{ "colors": {"value": ["yellow", "green"]},
       "sizes": {"value":["S", "M"]}`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;
    • putCategoricalFeaturesBuilderIfAbsent

      public FeatureMap.StringList.Builder putCategoricalFeaturesBuilderIfAbsent(String key)
       Categorical features that can take on one of a limited number of possible
       values. Some examples would be the brand/maker of a product, or country of
       a customer.
      
       Feature names and values must be UTF-8 encoded strings.
      
       For example: `{ "colors": {"value": ["yellow", "green"]},
       "sizes": {"value":["S", "M"]}`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;
    • getNumericalFeaturesCount

      public int getNumericalFeaturesCount()
      Description copied from interface: FeatureMapOrBuilder
       Numerical features. Some examples would be the height/weight of a product,
       or age of a customer.
      
       Feature names must be UTF-8 encoded strings.
      
       For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
       "heights_cm": {"value":[8.1, 6.4]} }`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;
      Specified by:
      getNumericalFeaturesCount in interface FeatureMapOrBuilder
    • containsNumericalFeatures

      public boolean containsNumericalFeatures(String key)
       Numerical features. Some examples would be the height/weight of a product,
       or age of a customer.
      
       Feature names must be UTF-8 encoded strings.
      
       For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
       "heights_cm": {"value":[8.1, 6.4]} }`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;
      Specified by:
      containsNumericalFeatures in interface FeatureMapOrBuilder
    • getNumericalFeatures

      @Deprecated public Map<String,FeatureMap.FloatList> getNumericalFeatures()
      Deprecated.
      Specified by:
      getNumericalFeatures in interface FeatureMapOrBuilder
    • getNumericalFeaturesMap

      public Map<String,FeatureMap.FloatList> getNumericalFeaturesMap()
       Numerical features. Some examples would be the height/weight of a product,
       or age of a customer.
      
       Feature names must be UTF-8 encoded strings.
      
       For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
       "heights_cm": {"value":[8.1, 6.4]} }`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;
      Specified by:
      getNumericalFeaturesMap in interface FeatureMapOrBuilder
    • getNumericalFeaturesOrDefault

      public FeatureMap.FloatList getNumericalFeaturesOrDefault(String key, FeatureMap.FloatList defaultValue)
       Numerical features. Some examples would be the height/weight of a product,
       or age of a customer.
      
       Feature names must be UTF-8 encoded strings.
      
       For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
       "heights_cm": {"value":[8.1, 6.4]} }`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;
      Specified by:
      getNumericalFeaturesOrDefault in interface FeatureMapOrBuilder
    • getNumericalFeaturesOrThrow

      public FeatureMap.FloatList getNumericalFeaturesOrThrow(String key)
       Numerical features. Some examples would be the height/weight of a product,
       or age of a customer.
      
       Feature names must be UTF-8 encoded strings.
      
       For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
       "heights_cm": {"value":[8.1, 6.4]} }`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;
      Specified by:
      getNumericalFeaturesOrThrow in interface FeatureMapOrBuilder
    • clearNumericalFeatures

      public FeatureMap.Builder clearNumericalFeatures()
    • removeNumericalFeatures

      public FeatureMap.Builder removeNumericalFeatures(String key)
       Numerical features. Some examples would be the height/weight of a product,
       or age of a customer.
      
       Feature names must be UTF-8 encoded strings.
      
       For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
       "heights_cm": {"value":[8.1, 6.4]} }`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;
    • getMutableNumericalFeatures

      @Deprecated public Map<String,FeatureMap.FloatList> getMutableNumericalFeatures()
      Deprecated.
      Use alternate mutation accessors instead.
    • putNumericalFeatures

      public FeatureMap.Builder putNumericalFeatures(String key, FeatureMap.FloatList value)
       Numerical features. Some examples would be the height/weight of a product,
       or age of a customer.
      
       Feature names must be UTF-8 encoded strings.
      
       For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
       "heights_cm": {"value":[8.1, 6.4]} }`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;
    • putAllNumericalFeatures

      public FeatureMap.Builder putAllNumericalFeatures(Map<String,FeatureMap.FloatList> values)
       Numerical features. Some examples would be the height/weight of a product,
       or age of a customer.
      
       Feature names must be UTF-8 encoded strings.
      
       For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
       "heights_cm": {"value":[8.1, 6.4]} }`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;
    • putNumericalFeaturesBuilderIfAbsent

      public FeatureMap.FloatList.Builder putNumericalFeaturesBuilderIfAbsent(String key)
       Numerical features. Some examples would be the height/weight of a product,
       or age of a customer.
      
       Feature names must be UTF-8 encoded strings.
      
       For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
       "heights_cm": {"value":[8.1, 6.4]} }`
       
      map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;