Class MapRules.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<MapRules.Builder>
com.google.protobuf.GeneratedMessageV3.Builder<MapRules.Builder>
build.buf.validate.MapRules.Builder
All Implemented Interfaces:
MapRulesOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
MapRules

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

    • 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<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.GeneratedMessageV3.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.GeneratedMessageV3.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
    • clone

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

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

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

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

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

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

      public MapRules.Builder mergeFrom(MapRules other)
    • isInitialized

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

      public MapRules.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<MapRules.Builder>
      Throws:
      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 [json_name = "minPairs", (.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 [json_name = "minPairs", (.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 [json_name = "minPairs", (.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 [json_name = "minPairs", (.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 [json_name = "maxPairs", (.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 [json_name = "maxPairs", (.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 [json_name = "maxPairs", (.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 [json_name = "maxPairs", (.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 [json_name = "keys"];
      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 [json_name = "keys"];
      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 [json_name = "keys"];
    • 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 [json_name = "keys"];
    • 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 [json_name = "keys"];
    • 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 [json_name = "keys"];
    • 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 [json_name = "keys"];
    • 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 [json_name = "keys"];
      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 [json_name = "values"];
      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 [json_name = "values"];
      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 [json_name = "values"];
    • 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 [json_name = "values"];
    • 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 [json_name = "values"];
    • 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 [json_name = "values"];
    • 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 [json_name = "values"];
    • 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 [json_name = "values"];
      Specified by:
      getValuesOrBuilder in interface MapRulesOrBuilder
    • setUnknownFields

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

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