Package build.buf.validate
Class RepeatedRules
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
build.buf.validate.RepeatedRules
- All Implemented Interfaces:
RepeatedRulesOrBuilder,com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Serializable
public final class RepeatedRules
extends com.google.protobuf.GeneratedMessageV3
implements RepeatedRulesOrBuilder
RepeatedRules describe the constraints applied to `repeated` values.Protobuf type
buf.validate.RepeatedRules- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepeatedRules describe the constraints applied to `repeated` values.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageV3
alwaysUseFieldBuilders, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic RepeatedRulesstatic final com.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.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.com.google.protobuf.Parser<RepeatedRules>intboolean`unique` indicates that all elements in this field must be unique.inthashCode()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 booleanstatic RepeatedRules.Builderstatic RepeatedRules.BuildernewBuilder(RepeatedRules prototype) protected RepeatedRules.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) static RepeatedRulesparseDelimitedFrom(InputStream input) static RepeatedRulesparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RepeatedRulesparseFrom(byte[] data) static RepeatedRulesparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RepeatedRulesparseFrom(com.google.protobuf.ByteString data) static RepeatedRulesparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RepeatedRulesparseFrom(com.google.protobuf.CodedInputStream input) static RepeatedRulesparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RepeatedRulesparseFrom(InputStream input) static RepeatedRulesparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RepeatedRulesparseFrom(ByteBuffer data) static RepeatedRulesparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<RepeatedRules>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
MIN_ITEMS_FIELD_NUMBER
public static final int MIN_ITEMS_FIELD_NUMBER- See Also:
-
MAX_ITEMS_FIELD_NUMBER
public static final int MAX_ITEMS_FIELD_NUMBER- See Also:
-
UNIQUE_FIELD_NUMBER
public static final int UNIQUE_FIELD_NUMBER- See Also:
-
ITEMS_FIELD_NUMBER
public static final int ITEMS_FIELD_NUMBER- See Also:
-
-
Method Details
-
newInstance
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
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
-
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.
-
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.
-
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.
-
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.
-
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
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static RepeatedRules parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RepeatedRules parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RepeatedRules parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RepeatedRules parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RepeatedRules parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RepeatedRules parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static RepeatedRules parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static RepeatedRules parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
public static RepeatedRules parseFrom(com.google.protobuf.CodedInputStream input) throws IOException - Throws:
IOException
-
parseFrom
public static RepeatedRules parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected RepeatedRules.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) - Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-