Class MapRules.Builder

  • All Implemented Interfaces:
    MapRulesOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, java.lang.Cloneable
    Enclosing class:
    MapRules

    public static final class MapRules.Builder
    extends com.google.protobuf.GeneratedMessage.Builder<MapRules.Builder>
    implements MapRulesOrBuilder
     MapRules describe the constraints applied to `map` values.
     
    Protobuf type buf.validate.MapRules
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      MapRules build()  
      MapRules buildPartial()  
      MapRules.Builder clear()  
      MapRules.Builder clearKeys()
      Specifies the constraints to be applied to each key in the field.
      MapRules.Builder clearMaxPairs()
      Specifies the maximum number of key-value pairs allowed.
      MapRules.Builder clearMinPairs()
      Specifies the minimum number of key-value pairs allowed.
      MapRules.Builder clearValues()
      Specifies the constraints to be applied to the value of each key in the field.
      MapRules getDefaultInstanceForType()  
      static com.google.protobuf.Descriptors.Descriptor getDescriptor()  
      com.google.protobuf.Descriptors.Descriptor getDescriptorForType()  
      FieldConstraints getKeys()
      Specifies the constraints to be applied to each key in the field.
      FieldConstraints.Builder getKeysBuilder()
      Specifies the constraints to be applied to each key in the field.
      FieldConstraintsOrBuilder getKeysOrBuilder()
      Specifies the constraints to be applied to each key in the field.
      long getMaxPairs()
      Specifies the maximum number of key-value pairs allowed.
      long getMinPairs()
      Specifies the minimum number of key-value pairs allowed.
      FieldConstraints getValues()
      Specifies the constraints to be applied to the value of each key in the field.
      FieldConstraints.Builder getValuesBuilder()
      Specifies the constraints to be applied to the value of each key in the field.
      FieldConstraintsOrBuilder getValuesOrBuilder()
      Specifies the constraints to be applied to the value of each key in the field.
      boolean hasKeys()
      Specifies the constraints to be applied to each key in the field.
      boolean hasMaxPairs()
      Specifies the maximum number of key-value pairs allowed.
      boolean hasMinPairs()
      Specifies the minimum number of key-value pairs allowed.
      boolean hasValues()
      Specifies the constraints to be applied to the value of each key in the field.
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()  
      boolean isInitialized()  
      MapRules.Builder mergeFrom​(MapRules other)  
      MapRules.Builder mergeFrom​(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      MapRules.Builder mergeFrom​(com.google.protobuf.Message other)  
      MapRules.Builder mergeKeys​(FieldConstraints value)
      Specifies the constraints to be applied to each key in the field.
      MapRules.Builder mergeValues​(FieldConstraints value)
      Specifies the constraints to be applied to the value of each key in the field.
      MapRules.Builder setKeys​(FieldConstraints value)
      Specifies the constraints to be applied to each key in the field.
      MapRules.Builder setKeys​(FieldConstraints.Builder builderForValue)
      Specifies the constraints to be applied to each key in the field.
      MapRules.Builder setMaxPairs​(long value)
      Specifies the maximum number of key-value pairs allowed.
      MapRules.Builder setMinPairs​(long value)
      Specifies the minimum number of key-value pairs allowed.
      MapRules.Builder setValues​(FieldConstraints value)
      Specifies the constraints to be applied to the value of each key in the field.
      MapRules.Builder setValues​(FieldConstraints.Builder builderForValue)
      Specifies the constraints to be applied to the value of each key in the field.
      • Methods inherited from class com.google.protobuf.GeneratedMessage.Builder

        addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3
      • Methods inherited from class com.google.protobuf.AbstractMessage.Builder

        findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
      • Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

        addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.google.protobuf.Message.Builder

        mergeDelimitedFrom, mergeDelimitedFrom
      • Methods inherited from interface com.google.protobuf.MessageLite.Builder

        mergeFrom
      • Methods inherited from interface com.google.protobuf.MessageOrBuilder

        findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

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

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

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

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

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

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

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

        public MapRules.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                   throws java.io.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<MapRules.Builder>
        Throws:
        java.io.IOException
      • hasMinPairs

        public boolean hasMinPairs()
         Specifies the minimum number of key-value pairs allowed. If the field has
         fewer key-value pairs than specified, an error message is generated.
        
         ```proto
         message MyMap {
         // The field `value` must have at least 2 key-value pairs.
         map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2];
         }
         ```
         
        optional uint64 min_pairs = 1 [(.buf.validate.priv.field) = { ... }
        Specified by:
        hasMinPairs in interface MapRulesOrBuilder
        Returns:
        Whether the minPairs field is set.
      • getMinPairs

        public long getMinPairs()
         Specifies the minimum number of key-value pairs allowed. If the field has
         fewer key-value pairs than specified, an error message is generated.
        
         ```proto
         message MyMap {
         // The field `value` must have at least 2 key-value pairs.
         map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2];
         }
         ```
         
        optional uint64 min_pairs = 1 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getMinPairs in interface MapRulesOrBuilder
        Returns:
        The minPairs.
      • setMinPairs

        public MapRules.Builder setMinPairs​(long value)
         Specifies the minimum number of key-value pairs allowed. If the field has
         fewer key-value pairs than specified, an error message is generated.
        
         ```proto
         message MyMap {
         // The field `value` must have at least 2 key-value pairs.
         map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2];
         }
         ```
         
        optional uint64 min_pairs = 1 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The minPairs to set.
        Returns:
        This builder for chaining.
      • clearMinPairs

        public MapRules.Builder clearMinPairs()
         Specifies the minimum number of key-value pairs allowed. If the field has
         fewer key-value pairs than specified, an error message is generated.
        
         ```proto
         message MyMap {
         // The field `value` must have at least 2 key-value pairs.
         map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2];
         }
         ```
         
        optional uint64 min_pairs = 1 [(.buf.validate.priv.field) = { ... }
        Returns:
        This builder for chaining.
      • hasMaxPairs

        public boolean hasMaxPairs()
         Specifies the maximum number of key-value pairs allowed. If the field has
         more key-value pairs than specified, an error message is generated.
        
         ```proto
         message MyMap {
         // The field `value` must have at most 3 key-value pairs.
         map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3];
         }
         ```
         
        optional uint64 max_pairs = 2 [(.buf.validate.priv.field) = { ... }
        Specified by:
        hasMaxPairs in interface MapRulesOrBuilder
        Returns:
        Whether the maxPairs field is set.
      • getMaxPairs

        public long getMaxPairs()
         Specifies the maximum number of key-value pairs allowed. If the field has
         more key-value pairs than specified, an error message is generated.
        
         ```proto
         message MyMap {
         // The field `value` must have at most 3 key-value pairs.
         map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3];
         }
         ```
         
        optional uint64 max_pairs = 2 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getMaxPairs in interface MapRulesOrBuilder
        Returns:
        The maxPairs.
      • setMaxPairs

        public MapRules.Builder setMaxPairs​(long value)
         Specifies the maximum number of key-value pairs allowed. If the field has
         more key-value pairs than specified, an error message is generated.
        
         ```proto
         message MyMap {
         // The field `value` must have at most 3 key-value pairs.
         map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3];
         }
         ```
         
        optional uint64 max_pairs = 2 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The maxPairs to set.
        Returns:
        This builder for chaining.
      • clearMaxPairs

        public MapRules.Builder clearMaxPairs()
         Specifies the maximum number of key-value pairs allowed. If the field has
         more key-value pairs than specified, an error message is generated.
        
         ```proto
         message MyMap {
         // The field `value` must have at most 3 key-value pairs.
         map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3];
         }
         ```
         
        optional uint64 max_pairs = 2 [(.buf.validate.priv.field) = { ... }
        Returns:
        This builder for chaining.
      • hasKeys

        public boolean hasKeys()
         Specifies the constraints to be applied to each key in the field.
        
         ```proto
         message MyMap {
         // The keys in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.keys = {
         string: {
         min_len: 3
         max_len: 10
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints keys = 4;
        Specified by:
        hasKeys in interface MapRulesOrBuilder
        Returns:
        Whether the keys field is set.
      • getKeys

        public FieldConstraints getKeys()
         Specifies the constraints to be applied to each key in the field.
        
         ```proto
         message MyMap {
         // The keys in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.keys = {
         string: {
         min_len: 3
         max_len: 10
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints keys = 4;
        Specified by:
        getKeys in interface MapRulesOrBuilder
        Returns:
        The keys.
      • setKeys

        public MapRules.Builder setKeys​(FieldConstraints value)
         Specifies the constraints to be applied to each key in the field.
        
         ```proto
         message MyMap {
         // The keys in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.keys = {
         string: {
         min_len: 3
         max_len: 10
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints keys = 4;
      • setKeys

        public MapRules.Builder setKeys​(FieldConstraints.Builder builderForValue)
         Specifies the constraints to be applied to each key in the field.
        
         ```proto
         message MyMap {
         // The keys in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.keys = {
         string: {
         min_len: 3
         max_len: 10
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints keys = 4;
      • mergeKeys

        public MapRules.Builder mergeKeys​(FieldConstraints value)
         Specifies the constraints to be applied to each key in the field.
        
         ```proto
         message MyMap {
         // The keys in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.keys = {
         string: {
         min_len: 3
         max_len: 10
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints keys = 4;
      • clearKeys

        public MapRules.Builder clearKeys()
         Specifies the constraints to be applied to each key in the field.
        
         ```proto
         message MyMap {
         // The keys in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.keys = {
         string: {
         min_len: 3
         max_len: 10
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints keys = 4;
      • getKeysBuilder

        public FieldConstraints.Builder getKeysBuilder()
         Specifies the constraints to be applied to each key in the field.
        
         ```proto
         message MyMap {
         // The keys in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.keys = {
         string: {
         min_len: 3
         max_len: 10
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints keys = 4;
      • getKeysOrBuilder

        public FieldConstraintsOrBuilder getKeysOrBuilder()
         Specifies the constraints to be applied to each key in the field.
        
         ```proto
         message MyMap {
         // The keys in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.keys = {
         string: {
         min_len: 3
         max_len: 10
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints keys = 4;
        Specified by:
        getKeysOrBuilder in interface MapRulesOrBuilder
      • hasValues

        public boolean hasValues()
         Specifies the constraints to be applied to the value of each key in the
         field. Message values will still have their validations evaluated unless
         skip is specified here.
        
         ```proto
         message MyMap {
         // The values in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.values = {
         string: {
         min_len: 5
         max_len: 20
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints values = 5;
        Specified by:
        hasValues in interface MapRulesOrBuilder
        Returns:
        Whether the values field is set.
      • getValues

        public FieldConstraints getValues()
         Specifies the constraints to be applied to the value of each key in the
         field. Message values will still have their validations evaluated unless
         skip is specified here.
        
         ```proto
         message MyMap {
         // The values in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.values = {
         string: {
         min_len: 5
         max_len: 20
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints values = 5;
        Specified by:
        getValues in interface MapRulesOrBuilder
        Returns:
        The values.
      • setValues

        public MapRules.Builder setValues​(FieldConstraints value)
         Specifies the constraints to be applied to the value of each key in the
         field. Message values will still have their validations evaluated unless
         skip is specified here.
        
         ```proto
         message MyMap {
         // The values in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.values = {
         string: {
         min_len: 5
         max_len: 20
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints values = 5;
      • setValues

        public MapRules.Builder setValues​(FieldConstraints.Builder builderForValue)
         Specifies the constraints to be applied to the value of each key in the
         field. Message values will still have their validations evaluated unless
         skip is specified here.
        
         ```proto
         message MyMap {
         // The values in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.values = {
         string: {
         min_len: 5
         max_len: 20
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints values = 5;
      • mergeValues

        public MapRules.Builder mergeValues​(FieldConstraints value)
         Specifies the constraints to be applied to the value of each key in the
         field. Message values will still have their validations evaluated unless
         skip is specified here.
        
         ```proto
         message MyMap {
         // The values in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.values = {
         string: {
         min_len: 5
         max_len: 20
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints values = 5;
      • clearValues

        public MapRules.Builder clearValues()
         Specifies the constraints to be applied to the value of each key in the
         field. Message values will still have their validations evaluated unless
         skip is specified here.
        
         ```proto
         message MyMap {
         // The values in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.values = {
         string: {
         min_len: 5
         max_len: 20
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints values = 5;
      • getValuesBuilder

        public FieldConstraints.Builder getValuesBuilder()
         Specifies the constraints to be applied to the value of each key in the
         field. Message values will still have their validations evaluated unless
         skip is specified here.
        
         ```proto
         message MyMap {
         // The values in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.values = {
         string: {
         min_len: 5
         max_len: 20
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints values = 5;
      • getValuesOrBuilder

        public FieldConstraintsOrBuilder getValuesOrBuilder()
         Specifies the constraints to be applied to the value of each key in the
         field. Message values will still have their validations evaluated unless
         skip is specified here.
        
         ```proto
         message MyMap {
         // The values in the field `value` must follow the specified constraints.
         map<string, string> value = 1 [(buf.validate.field).map.values = {
         string: {
         min_len: 5
         max_len: 20
         }
         }];
         }
         ```
         
        optional .buf.validate.FieldConstraints values = 5;
        Specified by:
        getValuesOrBuilder in interface MapRulesOrBuilder