Package build.buf.validate
Class RepeatedRules.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderT>
-
- com.google.protobuf.GeneratedMessage.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,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 typebuf.validate.RepeatedRules
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RepeatedRulesbuild()RepeatedRulesbuildPartial()RepeatedRules.Builderclear()RepeatedRules.BuilderclearItems()`items` details the constraints to be applied to each item in the field.RepeatedRules.BuilderclearMaxItems()`max_items` denotes that this field must not exceed a certain number of items as the upper limit.RepeatedRules.BuilderclearMinItems()`min_items` requires that this field must contain at least the specified minimum number of items.RepeatedRules.BuilderclearUnique()`unique` indicates that all elements in this field must be unique.RepeatedRulesgetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()FieldConstraintsgetItems()`items` details the constraints to be applied to each item in the field.FieldConstraints.BuildergetItemsBuilder()`items` details the constraints to be applied to each item in the field.FieldConstraintsOrBuildergetItemsOrBuilder()`items` details the constraints to be applied to each item in the field.longgetMaxItems()`max_items` denotes that this field must not exceed a certain number of items as the upper limit.longgetMinItems()`min_items` requires that this field must contain at least the specified minimum number of items.booleangetUnique()`unique` indicates that all elements in this field must be unique.booleanhasItems()`items` details the constraints to be applied to each item in the field.booleanhasMaxItems()`max_items` denotes that this field must not exceed a certain number of items as the upper limit.booleanhasMinItems()`min_items` requires that this field must contain at least the specified minimum number of items.booleanhasUnique()`unique` indicates that all elements in this field must be unique.protected com.google.protobuf.GeneratedMessage.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()RepeatedRules.BuildermergeFrom(RepeatedRules other)RepeatedRules.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)RepeatedRules.BuildermergeFrom(com.google.protobuf.Message other)RepeatedRules.BuildermergeItems(FieldConstraints value)`items` details the constraints to be applied to each item in the field.RepeatedRules.BuildersetItems(FieldConstraints value)`items` details the constraints to be applied to each item in the field.RepeatedRules.BuildersetItems(FieldConstraints.Builder builderForValue)`items` details the constraints to be applied to each item in the field.RepeatedRules.BuildersetMaxItems(long value)`max_items` denotes that this field must not exceed a certain number of items as the upper limit.RepeatedRules.BuildersetMinItems(long value)`min_items` requires that this field must contain at least the specified minimum number of items.RepeatedRules.BuildersetUnique(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
-
-
-
-
Method Detail
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<RepeatedRules.Builder>
-
clear
public RepeatedRules.Builder clear()
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<RepeatedRules.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<RepeatedRules.Builder>
-
getDefaultInstanceForType
public RepeatedRules getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public RepeatedRules build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public RepeatedRules buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
public RepeatedRules.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<RepeatedRules.Builder>
-
mergeFrom
public RepeatedRules.Builder mergeFrom(RepeatedRules other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.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:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.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:
hasMinItemsin interfaceRepeatedRulesOrBuilder- 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:
getMinItemsin interfaceRepeatedRulesOrBuilder- 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:
hasMaxItemsin interfaceRepeatedRulesOrBuilder- 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:
getMaxItemsin interfaceRepeatedRulesOrBuilder- 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:
hasUniquein interfaceRepeatedRulesOrBuilder- 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:
getUniquein interfaceRepeatedRulesOrBuilder- 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:
hasItemsin interfaceRepeatedRulesOrBuilder- 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:
getItemsin interfaceRepeatedRulesOrBuilder- 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:
getItemsOrBuilderin interfaceRepeatedRulesOrBuilder
-
-