Class RepeatedRules.Builder

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

public static final class RepeatedRules.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<RepeatedRules.Builder> implements RepeatedRulesOrBuilder
 RepeatedRules describe the constraints applied to `repeated` values.
 
Protobuf type buf.validate.RepeatedRules
  • 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<RepeatedRules.Builder>
    • clear

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

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

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

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

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

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

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

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

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

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

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

      public RepeatedRules.Builder mergeFrom(RepeatedRules other)
    • isInitialized

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

      public RepeatedRules.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<RepeatedRules.Builder>
      Throws:
      IOException
    • hasMinItems

      public boolean hasMinItems()
       `min_items` requires that this field must contain at least the specified
       minimum number of items.
      
       Note that `min_items = 1` is equivalent to setting a field as `required`.
      
       ```proto
       message MyRepeated {
         // value must contain at least  2 items
         repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];
       }
       ```
       
      optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... }
      Specified by:
      hasMinItems in interface RepeatedRulesOrBuilder
      Returns:
      Whether the minItems field is set.
    • getMinItems

      public long getMinItems()
       `min_items` requires that this field must contain at least the specified
       minimum number of items.
      
       Note that `min_items = 1` is equivalent to setting a field as `required`.
      
       ```proto
       message MyRepeated {
         // value must contain at least  2 items
         repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];
       }
       ```
       
      optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... }
      Specified by:
      getMinItems in interface RepeatedRulesOrBuilder
      Returns:
      The minItems.
    • setMinItems

      public RepeatedRules.Builder setMinItems(long value)
       `min_items` requires that this field must contain at least the specified
       minimum number of items.
      
       Note that `min_items = 1` is equivalent to setting a field as `required`.
      
       ```proto
       message MyRepeated {
         // value must contain at least  2 items
         repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];
       }
       ```
       
      optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... }
      Parameters:
      value - The minItems to set.
      Returns:
      This builder for chaining.
    • clearMinItems

      public RepeatedRules.Builder clearMinItems()
       `min_items` requires that this field must contain at least the specified
       minimum number of items.
      
       Note that `min_items = 1` is equivalent to setting a field as `required`.
      
       ```proto
       message MyRepeated {
         // value must contain at least  2 items
         repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];
       }
       ```
       
      optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... }
      Returns:
      This builder for chaining.
    • hasMaxItems

      public boolean hasMaxItems()
       `max_items` denotes that this field must not exceed a
       certain number of items as the upper limit. If the field contains more
       items than specified, an error message will be generated, requiring the
       field to maintain no more than the specified number of items.
      
       ```proto
       message MyRepeated {
         // value must contain no more than 3 item(s)
         repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];
       }
       ```
       
      optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... }
      Specified by:
      hasMaxItems in interface RepeatedRulesOrBuilder
      Returns:
      Whether the maxItems field is set.
    • getMaxItems

      public long getMaxItems()
       `max_items` denotes that this field must not exceed a
       certain number of items as the upper limit. If the field contains more
       items than specified, an error message will be generated, requiring the
       field to maintain no more than the specified number of items.
      
       ```proto
       message MyRepeated {
         // value must contain no more than 3 item(s)
         repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];
       }
       ```
       
      optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... }
      Specified by:
      getMaxItems in interface RepeatedRulesOrBuilder
      Returns:
      The maxItems.
    • setMaxItems

      public RepeatedRules.Builder setMaxItems(long value)
       `max_items` denotes that this field must not exceed a
       certain number of items as the upper limit. If the field contains more
       items than specified, an error message will be generated, requiring the
       field to maintain no more than the specified number of items.
      
       ```proto
       message MyRepeated {
         // value must contain no more than 3 item(s)
         repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];
       }
       ```
       
      optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... }
      Parameters:
      value - The maxItems to set.
      Returns:
      This builder for chaining.
    • clearMaxItems

      public RepeatedRules.Builder clearMaxItems()
       `max_items` denotes that this field must not exceed a
       certain number of items as the upper limit. If the field contains more
       items than specified, an error message will be generated, requiring the
       field to maintain no more than the specified number of items.
      
       ```proto
       message MyRepeated {
         // value must contain no more than 3 item(s)
         repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];
       }
       ```
       
      optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... }
      Returns:
      This builder for chaining.
    • hasUnique

      public boolean hasUnique()
       `unique` indicates that all elements in this field must
       be unique. This constraint is strictly applicable to scalar and enum
       types, with message types not being supported.
      
       ```proto
       message MyRepeated {
         // repeated value must contain unique items
         repeated string value = 1 [(buf.validate.field).repeated.unique = true];
       }
       ```
       
      optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... }
      Specified by:
      hasUnique in interface RepeatedRulesOrBuilder
      Returns:
      Whether the unique field is set.
    • getUnique

      public boolean getUnique()
       `unique` indicates that all elements in this field must
       be unique. This constraint is strictly applicable to scalar and enum
       types, with message types not being supported.
      
       ```proto
       message MyRepeated {
         // repeated value must contain unique items
         repeated string value = 1 [(buf.validate.field).repeated.unique = true];
       }
       ```
       
      optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... }
      Specified by:
      getUnique in interface RepeatedRulesOrBuilder
      Returns:
      The unique.
    • setUnique

      public RepeatedRules.Builder setUnique(boolean value)
       `unique` indicates that all elements in this field must
       be unique. This constraint is strictly applicable to scalar and enum
       types, with message types not being supported.
      
       ```proto
       message MyRepeated {
         // repeated value must contain unique items
         repeated string value = 1 [(buf.validate.field).repeated.unique = true];
       }
       ```
       
      optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... }
      Parameters:
      value - The unique to set.
      Returns:
      This builder for chaining.
    • clearUnique

      public RepeatedRules.Builder clearUnique()
       `unique` indicates that all elements in this field must
       be unique. This constraint is strictly applicable to scalar and enum
       types, with message types not being supported.
      
       ```proto
       message MyRepeated {
         // repeated value must contain unique items
         repeated string value = 1 [(buf.validate.field).repeated.unique = true];
       }
       ```
       
      optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... }
      Returns:
      This builder for chaining.
    • hasItems

      public boolean hasItems()
       `items` details the constraints to be applied to each item
       in the field. Even for repeated message fields, validation is executed
       against each item unless skip is explicitly specified.
      
       ```proto
       message MyRepeated {
         // The items in the field `value` must follow the specified constraints.
         repeated string value = 1 [(buf.validate.field).repeated.items = {
           string: {
             min_len: 3
             max_len: 10
           }
         }];
       }
       ```
       
      optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
      Specified by:
      hasItems in interface RepeatedRulesOrBuilder
      Returns:
      Whether the items field is set.
    • getItems

      public FieldConstraints getItems()
       `items` details the constraints to be applied to each item
       in the field. Even for repeated message fields, validation is executed
       against each item unless skip is explicitly specified.
      
       ```proto
       message MyRepeated {
         // The items in the field `value` must follow the specified constraints.
         repeated string value = 1 [(buf.validate.field).repeated.items = {
           string: {
             min_len: 3
             max_len: 10
           }
         }];
       }
       ```
       
      optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
      Specified by:
      getItems in interface RepeatedRulesOrBuilder
      Returns:
      The items.
    • setItems

      public RepeatedRules.Builder setItems(FieldConstraints value)
       `items` details the constraints to be applied to each item
       in the field. Even for repeated message fields, validation is executed
       against each item unless skip is explicitly specified.
      
       ```proto
       message MyRepeated {
         // The items in the field `value` must follow the specified constraints.
         repeated string value = 1 [(buf.validate.field).repeated.items = {
           string: {
             min_len: 3
             max_len: 10
           }
         }];
       }
       ```
       
      optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
    • setItems

      public RepeatedRules.Builder setItems(FieldConstraints.Builder builderForValue)
       `items` details the constraints to be applied to each item
       in the field. Even for repeated message fields, validation is executed
       against each item unless skip is explicitly specified.
      
       ```proto
       message MyRepeated {
         // The items in the field `value` must follow the specified constraints.
         repeated string value = 1 [(buf.validate.field).repeated.items = {
           string: {
             min_len: 3
             max_len: 10
           }
         }];
       }
       ```
       
      optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
    • mergeItems

      public RepeatedRules.Builder mergeItems(FieldConstraints value)
       `items` details the constraints to be applied to each item
       in the field. Even for repeated message fields, validation is executed
       against each item unless skip is explicitly specified.
      
       ```proto
       message MyRepeated {
         // The items in the field `value` must follow the specified constraints.
         repeated string value = 1 [(buf.validate.field).repeated.items = {
           string: {
             min_len: 3
             max_len: 10
           }
         }];
       }
       ```
       
      optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
    • clearItems

      public RepeatedRules.Builder clearItems()
       `items` details the constraints to be applied to each item
       in the field. Even for repeated message fields, validation is executed
       against each item unless skip is explicitly specified.
      
       ```proto
       message MyRepeated {
         // The items in the field `value` must follow the specified constraints.
         repeated string value = 1 [(buf.validate.field).repeated.items = {
           string: {
             min_len: 3
             max_len: 10
           }
         }];
       }
       ```
       
      optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
    • getItemsBuilder

      public FieldConstraints.Builder getItemsBuilder()
       `items` details the constraints to be applied to each item
       in the field. Even for repeated message fields, validation is executed
       against each item unless skip is explicitly specified.
      
       ```proto
       message MyRepeated {
         // The items in the field `value` must follow the specified constraints.
         repeated string value = 1 [(buf.validate.field).repeated.items = {
           string: {
             min_len: 3
             max_len: 10
           }
         }];
       }
       ```
       
      optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
    • getItemsOrBuilder

      public FieldConstraintsOrBuilder getItemsOrBuilder()
       `items` details the constraints to be applied to each item
       in the field. Even for repeated message fields, validation is executed
       against each item unless skip is explicitly specified.
      
       ```proto
       message MyRepeated {
         // The items in the field `value` must follow the specified constraints.
         repeated string value = 1 [(buf.validate.field).repeated.items = {
           string: {
             min_len: 3
             max_len: 10
           }
         }];
       }
       ```
       
      optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
      Specified by:
      getItemsOrBuilder in interface RepeatedRulesOrBuilder
    • setUnknownFields

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

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