Class 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.GeneratedMessageV3.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 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<FeatureMap.Builder>
      • internalGetMutableMapField

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

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

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

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

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

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

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

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

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

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

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