Class RepeatedRules.Builder

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

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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      RepeatedRules build()  
      RepeatedRules buildPartial()  
      RepeatedRules.Builder clear()  
      RepeatedRules.Builder clearItems()
      `items` details the constraints to be applied to each item in the field.
      RepeatedRules.Builder clearMaxItems()
      `max_items` denotes that this field must not exceed a certain number of items as the upper limit.
      RepeatedRules.Builder clearMinItems()
      `min_items` requires that this field must contain at least the specified minimum number of items.
      RepeatedRules.Builder clearUnique()
      `unique` indicates that all elements in this field must be unique.
      RepeatedRules getDefaultInstanceForType()  
      static com.google.protobuf.Descriptors.Descriptor getDescriptor()  
      com.google.protobuf.Descriptors.Descriptor getDescriptorForType()  
      FieldConstraints getItems()
      `items` details the constraints to be applied to each item in the field.
      FieldConstraints.Builder getItemsBuilder()
      `items` details the constraints to be applied to each item in the field.
      FieldConstraintsOrBuilder getItemsOrBuilder()
      `items` details the constraints to be applied to each item in the field.
      long getMaxItems()
      `max_items` denotes that this field must not exceed a certain number of items as the upper limit.
      long getMinItems()
      `min_items` requires that this field must contain at least the specified minimum number of items.
      boolean getUnique()
      `unique` indicates that all elements in this field must be unique.
      boolean hasItems()
      `items` details the constraints to be applied to each item in the field.
      boolean hasMaxItems()
      `max_items` denotes that this field must not exceed a certain number of items as the upper limit.
      boolean hasMinItems()
      `min_items` requires that this field must contain at least the specified minimum number of items.
      boolean hasUnique()
      `unique` indicates that all elements in this field must be unique.
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()  
      boolean isInitialized()  
      RepeatedRules.Builder mergeFrom​(RepeatedRules other)  
      RepeatedRules.Builder mergeFrom​(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      RepeatedRules.Builder mergeFrom​(com.google.protobuf.Message other)  
      RepeatedRules.Builder mergeItems​(FieldConstraints value)
      `items` details the constraints to be applied to each item in the field.
      RepeatedRules.Builder setItems​(FieldConstraints value)
      `items` details the constraints to be applied to each item in the field.
      RepeatedRules.Builder setItems​(FieldConstraints.Builder builderForValue)
      `items` details the constraints to be applied to each item in the field.
      RepeatedRules.Builder setMaxItems​(long value)
      `max_items` denotes that this field must not exceed a certain number of items as the upper limit.
      RepeatedRules.Builder setMinItems​(long value)
      `min_items` requires that this field must contain at least the specified minimum number of items.
      RepeatedRules.Builder setUnique​(boolean value)
      `unique` indicates that all elements in this field must be unique.
      • 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<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.GeneratedMessage.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.GeneratedMessage.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
      • 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>
      • isInitialized

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

        public RepeatedRules.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<RepeatedRules.Builder>
        Throws:
        java.io.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 [(.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 [(.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 [(.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 [(.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 [(.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 [(.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 [(.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 [(.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 [(.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 [(.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 [(.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 [(.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;
        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;
        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;
      • 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;
      • 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;
      • 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;
      • 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;
      • 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;
        Specified by:
        getItemsOrBuilder in interface RepeatedRulesOrBuilder