Package build.buf.validate
Class RepeatedRules.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
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 Summary
Modifier and TypeMethodDescriptionaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) build()clear()clearField(com.google.protobuf.Descriptors.FieldDescriptor field) `items` details the constraints to be applied to each item in the field.`max_items` denotes that this field must not exceed a certain number of items as the upper limit.`min_items` requires that this field must contain at least the specified minimum number of items.clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) `unique` indicates that all elements in this field must be unique.clone()static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorgetItems()`items` details the constraints to be applied to each item in the field.`items` details the constraints to be applied to each item in the field.`items` details the constraints to be applied to each item in the field.long`max_items` denotes that this field must not exceed a certain number of items as the upper limit.long`min_items` requires that this field must contain at least the specified minimum number of items.boolean`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.boolean`max_items` denotes that this field must not exceed a certain number of items as the upper limit.boolean`min_items` requires that this field must contain at least the specified minimum number of items.boolean`unique` indicates that all elements in this field must be unique.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanmergeFrom(RepeatedRules other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeItems(FieldConstraints value) `items` details the constraints to be applied to each item in the field.final RepeatedRules.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) setItems(FieldConstraints value) `items` details the constraints to be applied to each item in the field.setItems(FieldConstraints.Builder builderForValue) `items` details the constraints to be applied to each item in the field.setMaxItems(long value) `max_items` denotes that this field must not exceed a certain number of items as the upper limit.setMinItems(long value) `min_items` requires that this field must contain at least the specified minimum number of items.setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) setUnique(boolean value) `unique` indicates that all elements in this field must be unique.final RepeatedRules.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<RepeatedRules.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.Builder<RepeatedRules.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<RepeatedRules.Builder>
-
setField
public RepeatedRules.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<RepeatedRules.Builder>
-
clearField
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<RepeatedRules.Builder>
-
clearOneof
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<RepeatedRules.Builder>
-
setRepeatedField
public RepeatedRules.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) - Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<RepeatedRules.Builder>
-
addRepeatedField
public RepeatedRules.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<RepeatedRules.Builder>
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<RepeatedRules.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.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:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.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:
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 [json_name = "minItems", (.buf.validate.priv.field) = { ... }- Specified by:
getMinItemsin interfaceRepeatedRulesOrBuilder- Returns:
- The minItems.
-
setMinItems
`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
`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:
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 [json_name = "maxItems", (.buf.validate.priv.field) = { ... }- Specified by:
getMaxItemsin interfaceRepeatedRulesOrBuilder- Returns:
- The maxItems.
-
setMaxItems
`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
`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:
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 [json_name = "unique", (.buf.validate.priv.field) = { ... }- Specified by:
getUniquein interfaceRepeatedRulesOrBuilder- Returns:
- The unique.
-
setUnique
`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
`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:
hasItemsin interfaceRepeatedRulesOrBuilder- Returns:
- Whether the items field is set.
-
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:
getItemsin interfaceRepeatedRulesOrBuilder- Returns:
- The items.
-
setItems
`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
`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
`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
`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
`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
`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:
getItemsOrBuilderin interfaceRepeatedRulesOrBuilder
-
setUnknownFields
public final RepeatedRules.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<RepeatedRules.Builder>
-
mergeUnknownFields
public final RepeatedRules.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<RepeatedRules.Builder>
-