Class SparseFeature.Builder

  • All Implemented Interfaces:
    com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable, SparseFeatureOrBuilder
    Enclosing class:
    SparseFeature

    public static final class SparseFeature.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<SparseFeature.Builder>
    implements SparseFeatureOrBuilder
     A sparse feature represents a sparse tensor that is encoded with a
     combination of raw features, namely index features and a value feature. Each
     index feature defines a list of indices in a different dimension.
     
    Protobuf type tensorflow.metadata.v0.SparseFeature
    • 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<SparseFeature.Builder>
      • clear

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

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

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

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

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

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

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

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

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

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

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

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

        public SparseFeature.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<SparseFeature.Builder>
        Throws:
        IOException
      • hasName

        public boolean hasName()
         Name for the sparse feature. This should not clash with other features in
         the same schema.
         
        optional string name = 1;
        Specified by:
        hasName in interface SparseFeatureOrBuilder
        Returns:
        Whether the name field is set.
      • getName

        public String getName()
         Name for the sparse feature. This should not clash with other features in
         the same schema.
         
        optional string name = 1;
        Specified by:
        getName in interface SparseFeatureOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.ByteString getNameBytes()
         Name for the sparse feature. This should not clash with other features in
         the same schema.
         
        optional string name = 1;
        Specified by:
        getNameBytes in interface SparseFeatureOrBuilder
        Returns:
        The bytes for name.
      • setName

        public SparseFeature.Builder setName​(String value)
         Name for the sparse feature. This should not clash with other features in
         the same schema.
         
        optional string name = 1;
        Parameters:
        value - The name to set.
        Returns:
        This builder for chaining.
      • clearName

        public SparseFeature.Builder clearName()
         Name for the sparse feature. This should not clash with other features in
         the same schema.
         
        optional string name = 1;
        Returns:
        This builder for chaining.
      • setNameBytes

        public SparseFeature.Builder setNameBytes​(com.google.protobuf.ByteString value)
         Name for the sparse feature. This should not clash with other features in
         the same schema.
         
        optional string name = 1;
        Parameters:
        value - The bytes for name to set.
        Returns:
        This builder for chaining.
      • hasDeprecated

        @Deprecated
        public boolean hasDeprecated()
        Deprecated.
         This field is no longer supported. Instead, use:
         lifecycle_stage: DEPRECATED
         TODO(b/111450258): remove this.
         
        optional bool deprecated = 2 [deprecated = true];
        Specified by:
        hasDeprecated in interface SparseFeatureOrBuilder
        Returns:
        Whether the deprecated field is set.
      • getDeprecated

        @Deprecated
        public boolean getDeprecated()
        Deprecated.
         This field is no longer supported. Instead, use:
         lifecycle_stage: DEPRECATED
         TODO(b/111450258): remove this.
         
        optional bool deprecated = 2 [deprecated = true];
        Specified by:
        getDeprecated in interface SparseFeatureOrBuilder
        Returns:
        The deprecated.
      • setDeprecated

        @Deprecated
        public SparseFeature.Builder setDeprecated​(boolean value)
        Deprecated.
         This field is no longer supported. Instead, use:
         lifecycle_stage: DEPRECATED
         TODO(b/111450258): remove this.
         
        optional bool deprecated = 2 [deprecated = true];
        Parameters:
        value - The deprecated to set.
        Returns:
        This builder for chaining.
      • clearDeprecated

        @Deprecated
        public SparseFeature.Builder clearDeprecated()
        Deprecated.
         This field is no longer supported. Instead, use:
         lifecycle_stage: DEPRECATED
         TODO(b/111450258): remove this.
         
        optional bool deprecated = 2 [deprecated = true];
        Returns:
        This builder for chaining.
      • hasLifecycleStage

        public boolean hasLifecycleStage()
         The lifecycle_stage determines where a feature is expected to be used,
         and therefore how important issues with it are.
         
        optional .tensorflow.metadata.v0.LifecycleStage lifecycle_stage = 7;
        Specified by:
        hasLifecycleStage in interface SparseFeatureOrBuilder
        Returns:
        Whether the lifecycleStage field is set.
      • getLifecycleStage

        public LifecycleStage getLifecycleStage()
         The lifecycle_stage determines where a feature is expected to be used,
         and therefore how important issues with it are.
         
        optional .tensorflow.metadata.v0.LifecycleStage lifecycle_stage = 7;
        Specified by:
        getLifecycleStage in interface SparseFeatureOrBuilder
        Returns:
        The lifecycleStage.
      • setLifecycleStage

        public SparseFeature.Builder setLifecycleStage​(LifecycleStage value)
         The lifecycle_stage determines where a feature is expected to be used,
         and therefore how important issues with it are.
         
        optional .tensorflow.metadata.v0.LifecycleStage lifecycle_stage = 7;
        Parameters:
        value - The lifecycleStage to set.
        Returns:
        This builder for chaining.
      • clearLifecycleStage

        public SparseFeature.Builder clearLifecycleStage()
         The lifecycle_stage determines where a feature is expected to be used,
         and therefore how important issues with it are.
         
        optional .tensorflow.metadata.v0.LifecycleStage lifecycle_stage = 7;
        Returns:
        This builder for chaining.
      • hasPresence

        @Deprecated
        public boolean hasPresence()
        Deprecated.
         Constraints on the presence of this feature in examples.
         Deprecated, this is inferred by the referred features.
         
        optional .tensorflow.metadata.v0.FeaturePresence presence = 4 [deprecated = true];
        Specified by:
        hasPresence in interface SparseFeatureOrBuilder
        Returns:
        Whether the presence field is set.
      • getPresence

        @Deprecated
        public FeaturePresence getPresence()
        Deprecated.
         Constraints on the presence of this feature in examples.
         Deprecated, this is inferred by the referred features.
         
        optional .tensorflow.metadata.v0.FeaturePresence presence = 4 [deprecated = true];
        Specified by:
        getPresence in interface SparseFeatureOrBuilder
        Returns:
        The presence.
      • setPresence

        @Deprecated
        public SparseFeature.Builder setPresence​(FeaturePresence value)
        Deprecated.
         Constraints on the presence of this feature in examples.
         Deprecated, this is inferred by the referred features.
         
        optional .tensorflow.metadata.v0.FeaturePresence presence = 4 [deprecated = true];
      • setPresence

        @Deprecated
        public SparseFeature.Builder setPresence​(FeaturePresence.Builder builderForValue)
        Deprecated.
         Constraints on the presence of this feature in examples.
         Deprecated, this is inferred by the referred features.
         
        optional .tensorflow.metadata.v0.FeaturePresence presence = 4 [deprecated = true];
      • mergePresence

        @Deprecated
        public SparseFeature.Builder mergePresence​(FeaturePresence value)
        Deprecated.
         Constraints on the presence of this feature in examples.
         Deprecated, this is inferred by the referred features.
         
        optional .tensorflow.metadata.v0.FeaturePresence presence = 4 [deprecated = true];
      • clearPresence

        @Deprecated
        public SparseFeature.Builder clearPresence()
        Deprecated.
         Constraints on the presence of this feature in examples.
         Deprecated, this is inferred by the referred features.
         
        optional .tensorflow.metadata.v0.FeaturePresence presence = 4 [deprecated = true];
      • getPresenceBuilder

        @Deprecated
        public FeaturePresence.Builder getPresenceBuilder()
        Deprecated.
         Constraints on the presence of this feature in examples.
         Deprecated, this is inferred by the referred features.
         
        optional .tensorflow.metadata.v0.FeaturePresence presence = 4 [deprecated = true];
      • hasDenseShape

        public boolean hasDenseShape()
         Shape of the sparse tensor that this SparseFeature represents.
         Currently not supported.
         TODO(b/109669962): Consider deriving this from the referred features.
         
        optional .tensorflow.metadata.v0.FixedShape dense_shape = 5;
        Specified by:
        hasDenseShape in interface SparseFeatureOrBuilder
        Returns:
        Whether the denseShape field is set.
      • getDenseShape

        public FixedShape getDenseShape()
         Shape of the sparse tensor that this SparseFeature represents.
         Currently not supported.
         TODO(b/109669962): Consider deriving this from the referred features.
         
        optional .tensorflow.metadata.v0.FixedShape dense_shape = 5;
        Specified by:
        getDenseShape in interface SparseFeatureOrBuilder
        Returns:
        The denseShape.
      • setDenseShape

        public SparseFeature.Builder setDenseShape​(FixedShape value)
         Shape of the sparse tensor that this SparseFeature represents.
         Currently not supported.
         TODO(b/109669962): Consider deriving this from the referred features.
         
        optional .tensorflow.metadata.v0.FixedShape dense_shape = 5;
      • setDenseShape

        public SparseFeature.Builder setDenseShape​(FixedShape.Builder builderForValue)
         Shape of the sparse tensor that this SparseFeature represents.
         Currently not supported.
         TODO(b/109669962): Consider deriving this from the referred features.
         
        optional .tensorflow.metadata.v0.FixedShape dense_shape = 5;
      • mergeDenseShape

        public SparseFeature.Builder mergeDenseShape​(FixedShape value)
         Shape of the sparse tensor that this SparseFeature represents.
         Currently not supported.
         TODO(b/109669962): Consider deriving this from the referred features.
         
        optional .tensorflow.metadata.v0.FixedShape dense_shape = 5;
      • clearDenseShape

        public SparseFeature.Builder clearDenseShape()
         Shape of the sparse tensor that this SparseFeature represents.
         Currently not supported.
         TODO(b/109669962): Consider deriving this from the referred features.
         
        optional .tensorflow.metadata.v0.FixedShape dense_shape = 5;
      • getDenseShapeBuilder

        public FixedShape.Builder getDenseShapeBuilder()
         Shape of the sparse tensor that this SparseFeature represents.
         Currently not supported.
         TODO(b/109669962): Consider deriving this from the referred features.
         
        optional .tensorflow.metadata.v0.FixedShape dense_shape = 5;
      • getDenseShapeOrBuilder

        public FixedShapeOrBuilder getDenseShapeOrBuilder()
         Shape of the sparse tensor that this SparseFeature represents.
         Currently not supported.
         TODO(b/109669962): Consider deriving this from the referred features.
         
        optional .tensorflow.metadata.v0.FixedShape dense_shape = 5;
        Specified by:
        getDenseShapeOrBuilder in interface SparseFeatureOrBuilder
      • getIndexFeatureCount

        public int getIndexFeatureCount()
         Features that represent indexes. Should be integers >= 0.
         
        repeated .tensorflow.metadata.v0.SparseFeature.IndexFeature index_feature = 6;
        Specified by:
        getIndexFeatureCount in interface SparseFeatureOrBuilder
      • setIndexFeature

        public SparseFeature.Builder setIndexFeature​(int index,
                                                     SparseFeature.IndexFeature value)
         Features that represent indexes. Should be integers >= 0.
         
        repeated .tensorflow.metadata.v0.SparseFeature.IndexFeature index_feature = 6;
      • addIndexFeature

        public SparseFeature.Builder addIndexFeature​(SparseFeature.IndexFeature value)
         Features that represent indexes. Should be integers >= 0.
         
        repeated .tensorflow.metadata.v0.SparseFeature.IndexFeature index_feature = 6;
      • addIndexFeature

        public SparseFeature.Builder addIndexFeature​(int index,
                                                     SparseFeature.IndexFeature value)
         Features that represent indexes. Should be integers >= 0.
         
        repeated .tensorflow.metadata.v0.SparseFeature.IndexFeature index_feature = 6;
      • clearIndexFeature

        public SparseFeature.Builder clearIndexFeature()
         Features that represent indexes. Should be integers >= 0.
         
        repeated .tensorflow.metadata.v0.SparseFeature.IndexFeature index_feature = 6;
      • removeIndexFeature

        public SparseFeature.Builder removeIndexFeature​(int index)
         Features that represent indexes. Should be integers >= 0.
         
        repeated .tensorflow.metadata.v0.SparseFeature.IndexFeature index_feature = 6;
      • getIndexFeatureBuilder

        public SparseFeature.IndexFeature.Builder getIndexFeatureBuilder​(int index)
         Features that represent indexes. Should be integers >= 0.
         
        repeated .tensorflow.metadata.v0.SparseFeature.IndexFeature index_feature = 6;
      • addIndexFeatureBuilder

        public SparseFeature.IndexFeature.Builder addIndexFeatureBuilder()
         Features that represent indexes. Should be integers >= 0.
         
        repeated .tensorflow.metadata.v0.SparseFeature.IndexFeature index_feature = 6;
      • addIndexFeatureBuilder

        public SparseFeature.IndexFeature.Builder addIndexFeatureBuilder​(int index)
         Features that represent indexes. Should be integers >= 0.
         
        repeated .tensorflow.metadata.v0.SparseFeature.IndexFeature index_feature = 6;
      • getIndexFeatureBuilderList

        public List<SparseFeature.IndexFeature.Builder> getIndexFeatureBuilderList()
         Features that represent indexes. Should be integers >= 0.
         
        repeated .tensorflow.metadata.v0.SparseFeature.IndexFeature index_feature = 6;
      • hasIsSorted

        public boolean hasIsSorted()
         If true then the index values are already sorted lexicographically.
         
        optional bool is_sorted = 8;
        Specified by:
        hasIsSorted in interface SparseFeatureOrBuilder
        Returns:
        Whether the isSorted field is set.
      • getIsSorted

        public boolean getIsSorted()
         If true then the index values are already sorted lexicographically.
         
        optional bool is_sorted = 8;
        Specified by:
        getIsSorted in interface SparseFeatureOrBuilder
        Returns:
        The isSorted.
      • setIsSorted

        public SparseFeature.Builder setIsSorted​(boolean value)
         If true then the index values are already sorted lexicographically.
         
        optional bool is_sorted = 8;
        Parameters:
        value - The isSorted to set.
        Returns:
        This builder for chaining.
      • clearIsSorted

        public SparseFeature.Builder clearIsSorted()
         If true then the index values are already sorted lexicographically.
         
        optional bool is_sorted = 8;
        Returns:
        This builder for chaining.
      • hasValueFeature

        public boolean hasValueFeature()
         required
         
        optional .tensorflow.metadata.v0.SparseFeature.ValueFeature value_feature = 9;
        Specified by:
        hasValueFeature in interface SparseFeatureOrBuilder
        Returns:
        Whether the valueFeature field is set.
      • clearValueFeature

        public SparseFeature.Builder clearValueFeature()
         required
         
        optional .tensorflow.metadata.v0.SparseFeature.ValueFeature value_feature = 9;
      • getValueFeatureBuilder

        public SparseFeature.ValueFeature.Builder getValueFeatureBuilder()
         required
         
        optional .tensorflow.metadata.v0.SparseFeature.ValueFeature value_feature = 9;
      • hasType

        @Deprecated
        public boolean hasType()
        Deprecated.
         Type of value feature.
         Deprecated, this is inferred by the referred features.
         
        optional .tensorflow.metadata.v0.FeatureType type = 10 [deprecated = true];
        Specified by:
        hasType in interface SparseFeatureOrBuilder
        Returns:
        Whether the type field is set.
      • getType

        @Deprecated
        public FeatureType getType()
        Deprecated.
         Type of value feature.
         Deprecated, this is inferred by the referred features.
         
        optional .tensorflow.metadata.v0.FeatureType type = 10 [deprecated = true];
        Specified by:
        getType in interface SparseFeatureOrBuilder
        Returns:
        The type.
      • setType

        @Deprecated
        public SparseFeature.Builder setType​(FeatureType value)
        Deprecated.
         Type of value feature.
         Deprecated, this is inferred by the referred features.
         
        optional .tensorflow.metadata.v0.FeatureType type = 10 [deprecated = true];
        Parameters:
        value - The type to set.
        Returns:
        This builder for chaining.
      • clearType

        @Deprecated
        public SparseFeature.Builder clearType()
        Deprecated.
         Type of value feature.
         Deprecated, this is inferred by the referred features.
         
        optional .tensorflow.metadata.v0.FeatureType type = 10 [deprecated = true];
        Returns:
        This builder for chaining.
      • setUnknownFields

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

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