Package build.buf.validate
Class StringRules.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<StringRules.Builder>
com.google.protobuf.GeneratedMessage.Builder<StringRules.Builder>
build.buf.validate.StringRules.Builder
- All Implemented Interfaces:
StringRulesOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
StringRules
public static final class StringRules.Builder
extends com.google.protobuf.GeneratedMessage.Builder<StringRules.Builder>
implements StringRulesOrBuilder
StringRules describes the constraints applied to `string` values These rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type.Protobuf type
buf.validate.StringRules-
Method Summary
Modifier and TypeMethodDescription`in` specifies that the field value must be equal to one of the specified values.addAllNotIn(Iterable<String> values) `not_in` specifies that the field value cannot be equal to any of the specified values.`in` specifies that the field value must be equal to one of the specified values.addInBytes(com.google.protobuf.ByteString value) `in` specifies that the field value must be equal to one of the specified values.`not_in` specifies that the field value cannot be equal to any of the specified values.addNotInBytes(com.google.protobuf.ByteString value) `not_in` specifies that the field value cannot be equal to any of the specified values.build()clear()`address` specifies that the field value must be either a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) (which doesn't support internationalized domain names or IDNs) or a valid IP (v4 or v6).`const` requires the field value to exactly match the specified value.`contains` specifies that the field value must have the specified substring anywhere in the string.`email` specifies that the field value must be a valid email address (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1).`host_and_port` specifies the field value must be a valid host and port pair.`hostname` specifies that the field value must be a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5).clearIn()`in` specifies that the field value must be equal to one of the specified values.clearIp()`ip` specifies that the field value must be a valid IP (v4 or v6) address, without surrounding square brackets for IPv6 addresses.`ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix.`ipv4` specifies that the field value must be a valid IPv4 address.`ipv4_prefix` specifies that the field value must be a valid IPv4 prefix.`ipv4_with_prefixlen` specifies that the field value must be a valid IPv4 address with prefix.`ipv6` specifies that the field value must be a valid IPv6 address, without surrounding square brackets.`ipv6_prefix` specifies that the field value must be a valid IPv6 prefix.`ipv6_with_prefixlen` specifies that the field value must be a valid IPv6 address with prefix length.`ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6) address with prefix length.clearLen()`len` dictates that the field value must have the specified number of characters (Unicode code points), which may differ from the number of bytes in the string.`len_bytes` dictates that the field value must have the specified number of bytes.`max_bytes` specifies that the field value must have no more than the specified number of bytes.`max_len` specifies that the field value must have no more than the specified number of characters (Unicode code points), which may differ from the number of bytes in the string.`min_bytes` specifies that the field value must have at least the specified number of bytes.`min_len` specifies that the field value must have at least the specified number of characters (Unicode code points), which may differ from the number of bytes in the string.`not_contains` specifies that the field value must not have the specified substring anywhere in the string.`not_in` specifies that the field value cannot be equal to any of the specified values.`pattern` specifies that the field value must match the specified regular expression (RE2 syntax), with the expression provided without any delimiters.`prefix` specifies that the field value must have the specified substring at the beginning of the string.This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to enable strict header validation.`suffix` specifies that the field value must have the specified substring at the end of the string.`tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2) with all dashes omitted.clearUri()`uri` specifies that the field value must be a valid, absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3).`uri_ref` specifies that the field value must be a valid URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute.`uuid` specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2).`well_known_regex` specifies a common well-known pattern defined as a regex.boolean`address` specifies that the field value must be either a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) (which doesn't support internationalized domain names or IDNs) or a valid IP (v4 or v6).getConst()`const` requires the field value to exactly match the specified value.com.google.protobuf.ByteString`const` requires the field value to exactly match the specified value.`contains` specifies that the field value must have the specified substring anywhere in the string.com.google.protobuf.ByteString`contains` specifies that the field value must have the specified substring anywhere in the string.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorbooleangetEmail()`email` specifies that the field value must be a valid email address (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1).boolean`host_and_port` specifies the field value must be a valid host and port pair.boolean`hostname` specifies that the field value must be a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5).getIn(int index) `in` specifies that the field value must be equal to one of the specified values.com.google.protobuf.ByteStringgetInBytes(int index) `in` specifies that the field value must be equal to one of the specified values.int`in` specifies that the field value must be equal to one of the specified values.com.google.protobuf.ProtocolStringList`in` specifies that the field value must be equal to one of the specified values.booleangetIp()`ip` specifies that the field value must be a valid IP (v4 or v6) address, without surrounding square brackets for IPv6 addresses.boolean`ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix.booleangetIpv4()`ipv4` specifies that the field value must be a valid IPv4 address.boolean`ipv4_prefix` specifies that the field value must be a valid IPv4 prefix.boolean`ipv4_with_prefixlen` specifies that the field value must be a valid IPv4 address with prefix.booleangetIpv6()`ipv6` specifies that the field value must be a valid IPv6 address, without surrounding square brackets.boolean`ipv6_prefix` specifies that the field value must be a valid IPv6 prefix.boolean`ipv6_with_prefixlen` specifies that the field value must be a valid IPv6 address with prefix length.boolean`ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6) address with prefix length.longgetLen()`len` dictates that the field value must have the specified number of characters (Unicode code points), which may differ from the number of bytes in the string.long`len_bytes` dictates that the field value must have the specified number of bytes.long`max_bytes` specifies that the field value must have no more than the specified number of bytes.long`max_len` specifies that the field value must have no more than the specified number of characters (Unicode code points), which may differ from the number of bytes in the string.long`min_bytes` specifies that the field value must have at least the specified number of bytes.long`min_len` specifies that the field value must have at least the specified number of characters (Unicode code points), which may differ from the number of bytes in the string.`not_contains` specifies that the field value must not have the specified substring anywhere in the string.com.google.protobuf.ByteString`not_contains` specifies that the field value must not have the specified substring anywhere in the string.getNotIn(int index) `not_in` specifies that the field value cannot be equal to any of the specified values.com.google.protobuf.ByteStringgetNotInBytes(int index) `not_in` specifies that the field value cannot be equal to any of the specified values.int`not_in` specifies that the field value cannot be equal to any of the specified values.com.google.protobuf.ProtocolStringList`not_in` specifies that the field value cannot be equal to any of the specified values.`pattern` specifies that the field value must match the specified regular expression (RE2 syntax), with the expression provided without any delimiters.com.google.protobuf.ByteString`pattern` specifies that the field value must match the specified regular expression (RE2 syntax), with the expression provided without any delimiters.`prefix` specifies that the field value must have the specified substring at the beginning of the string.com.google.protobuf.ByteString`prefix` specifies that the field value must have the specified substring at the beginning of the string.booleanThis applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to enable strict header validation.`suffix` specifies that the field value must have the specified substring at the end of the string.com.google.protobuf.ByteString`suffix` specifies that the field value must have the specified substring at the end of the string.booleangetTuuid()`tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2) with all dashes omitted.booleangetUri()`uri` specifies that the field value must be a valid, absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3).boolean`uri_ref` specifies that the field value must be a valid URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute.booleangetUuid()`uuid` specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2).`well_known_regex` specifies a common well-known pattern defined as a regex.int`well_known_regex` specifies a common well-known pattern defined as a regex.boolean`address` specifies that the field value must be either a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) (which doesn't support internationalized domain names or IDNs) or a valid IP (v4 or v6).booleanhasConst()`const` requires the field value to exactly match the specified value.boolean`contains` specifies that the field value must have the specified substring anywhere in the string.booleanhasEmail()`email` specifies that the field value must be a valid email address (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1).boolean`host_and_port` specifies the field value must be a valid host and port pair.boolean`hostname` specifies that the field value must be a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5).booleanhasIp()`ip` specifies that the field value must be a valid IP (v4 or v6) address, without surrounding square brackets for IPv6 addresses.boolean`ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix.booleanhasIpv4()`ipv4` specifies that the field value must be a valid IPv4 address.boolean`ipv4_prefix` specifies that the field value must be a valid IPv4 prefix.boolean`ipv4_with_prefixlen` specifies that the field value must be a valid IPv4 address with prefix.booleanhasIpv6()`ipv6` specifies that the field value must be a valid IPv6 address, without surrounding square brackets.boolean`ipv6_prefix` specifies that the field value must be a valid IPv6 prefix.boolean`ipv6_with_prefixlen` specifies that the field value must be a valid IPv6 address with prefix length.boolean`ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6) address with prefix length.booleanhasLen()`len` dictates that the field value must have the specified number of characters (Unicode code points), which may differ from the number of bytes in the string.boolean`len_bytes` dictates that the field value must have the specified number of bytes.boolean`max_bytes` specifies that the field value must have no more than the specified number of bytes.boolean`max_len` specifies that the field value must have no more than the specified number of characters (Unicode code points), which may differ from the number of bytes in the string.boolean`min_bytes` specifies that the field value must have at least the specified number of bytes.boolean`min_len` specifies that the field value must have at least the specified number of characters (Unicode code points), which may differ from the number of bytes in the string.boolean`not_contains` specifies that the field value must not have the specified substring anywhere in the string.boolean`pattern` specifies that the field value must match the specified regular expression (RE2 syntax), with the expression provided without any delimiters.boolean`prefix` specifies that the field value must have the specified substring at the beginning of the string.booleanThis applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to enable strict header validation.boolean`suffix` specifies that the field value must have the specified substring at the end of the string.booleanhasTuuid()`tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2) with all dashes omitted.booleanhasUri()`uri` specifies that the field value must be a valid, absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3).boolean`uri_ref` specifies that the field value must be a valid URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute.booleanhasUuid()`uuid` specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2).boolean`well_known_regex` specifies a common well-known pattern defined as a regex.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(StringRules other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) setAddress(boolean value) `address` specifies that the field value must be either a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) (which doesn't support internationalized domain names or IDNs) or a valid IP (v4 or v6).`const` requires the field value to exactly match the specified value.setConstBytes(com.google.protobuf.ByteString value) `const` requires the field value to exactly match the specified value.setContains(String value) `contains` specifies that the field value must have the specified substring anywhere in the string.setContainsBytes(com.google.protobuf.ByteString value) `contains` specifies that the field value must have the specified substring anywhere in the string.setEmail(boolean value) `email` specifies that the field value must be a valid email address (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1).setHostAndPort(boolean value) `host_and_port` specifies the field value must be a valid host and port pair.setHostname(boolean value) `hostname` specifies that the field value must be a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5).`in` specifies that the field value must be equal to one of the specified values.setIp(boolean value) `ip` specifies that the field value must be a valid IP (v4 or v6) address, without surrounding square brackets for IPv6 addresses.setIpPrefix(boolean value) `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix.setIpv4(boolean value) `ipv4` specifies that the field value must be a valid IPv4 address.setIpv4Prefix(boolean value) `ipv4_prefix` specifies that the field value must be a valid IPv4 prefix.setIpv4WithPrefixlen(boolean value) `ipv4_with_prefixlen` specifies that the field value must be a valid IPv4 address with prefix.setIpv6(boolean value) `ipv6` specifies that the field value must be a valid IPv6 address, without surrounding square brackets.setIpv6Prefix(boolean value) `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix.setIpv6WithPrefixlen(boolean value) `ipv6_with_prefixlen` specifies that the field value must be a valid IPv6 address with prefix length.setIpWithPrefixlen(boolean value) `ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6) address with prefix length.setLen(long value) `len` dictates that the field value must have the specified number of characters (Unicode code points), which may differ from the number of bytes in the string.setLenBytes(long value) `len_bytes` dictates that the field value must have the specified number of bytes.setMaxBytes(long value) `max_bytes` specifies that the field value must have no more than the specified number of bytes.setMaxLen(long value) `max_len` specifies that the field value must have no more than the specified number of characters (Unicode code points), which may differ from the number of bytes in the string.setMinBytes(long value) `min_bytes` specifies that the field value must have at least the specified number of bytes.setMinLen(long value) `min_len` specifies that the field value must have at least the specified number of characters (Unicode code points), which may differ from the number of bytes in the string.setNotContains(String value) `not_contains` specifies that the field value must not have the specified substring anywhere in the string.setNotContainsBytes(com.google.protobuf.ByteString value) `not_contains` specifies that the field value must not have the specified substring anywhere in the string.`not_in` specifies that the field value cannot be equal to any of the specified values.setPattern(String value) `pattern` specifies that the field value must match the specified regular expression (RE2 syntax), with the expression provided without any delimiters.setPatternBytes(com.google.protobuf.ByteString value) `pattern` specifies that the field value must match the specified regular expression (RE2 syntax), with the expression provided without any delimiters.`prefix` specifies that the field value must have the specified substring at the beginning of the string.setPrefixBytes(com.google.protobuf.ByteString value) `prefix` specifies that the field value must have the specified substring at the beginning of the string.setStrict(boolean value) This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to enable strict header validation.`suffix` specifies that the field value must have the specified substring at the end of the string.setSuffixBytes(com.google.protobuf.ByteString value) `suffix` specifies that the field value must have the specified substring at the end of the string.setTuuid(boolean value) `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2) with all dashes omitted.setUri(boolean value) `uri` specifies that the field value must be a valid, absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3).setUriRef(boolean value) `uri_ref` specifies that the field value must be a valid URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute.setUuid(boolean value) `uuid` specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2).setWellKnownRegex(KnownRegex value) `well_known_regex` specifies a common well-known pattern defined as a regex.setWellKnownRegexValue(int value) `well_known_regex` specifies a common well-known pattern defined as a regex.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, 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.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<StringRules.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<StringRules.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<StringRules.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
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<StringRules.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<StringRules.Builder>
-
mergeFrom
public StringRules.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<StringRules.Builder>- Throws:
IOException
-
getWellKnownCase
- Specified by:
getWellKnownCasein interfaceStringRulesOrBuilder
-
clearWellKnown
-
hasConst
public boolean hasConst()`const` requires the field value to exactly match the specified value. If the field value doesn't match, an error message is generated. ```proto message MyString { // value must equal `hello` string value = 1 [(buf.validate.field).string.const = "hello"]; } ```optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... }- Specified by:
hasConstin interfaceStringRulesOrBuilder- Returns:
- Whether the const field is set.
-
getConst
`const` requires the field value to exactly match the specified value. If the field value doesn't match, an error message is generated. ```proto message MyString { // value must equal `hello` string value = 1 [(buf.validate.field).string.const = "hello"]; } ```optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... }- Specified by:
getConstin interfaceStringRulesOrBuilder- Returns:
- The const.
-
getConstBytes
public com.google.protobuf.ByteString getConstBytes()`const` requires the field value to exactly match the specified value. If the field value doesn't match, an error message is generated. ```proto message MyString { // value must equal `hello` string value = 1 [(buf.validate.field).string.const = "hello"]; } ```optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... }- Specified by:
getConstBytesin interfaceStringRulesOrBuilder- Returns:
- The bytes for const.
-
setConst
`const` requires the field value to exactly match the specified value. If the field value doesn't match, an error message is generated. ```proto message MyString { // value must equal `hello` string value = 1 [(buf.validate.field).string.const = "hello"]; } ```optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... }- Parameters:
value- The const to set.- Returns:
- This builder for chaining.
-
clearConst
`const` requires the field value to exactly match the specified value. If the field value doesn't match, an error message is generated. ```proto message MyString { // value must equal `hello` string value = 1 [(buf.validate.field).string.const = "hello"]; } ```optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
setConstBytes
`const` requires the field value to exactly match the specified value. If the field value doesn't match, an error message is generated. ```proto message MyString { // value must equal `hello` string value = 1 [(buf.validate.field).string.const = "hello"]; } ```optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... }- Parameters:
value- The bytes for const to set.- Returns:
- This builder for chaining.
-
hasLen
public boolean hasLen()`len` dictates that the field value must have the specified number of characters (Unicode code points), which may differ from the number of bytes in the string. If the field value does not meet the specified length, an error message will be generated. ```proto message MyString { // value length must be 5 characters string value = 1 [(buf.validate.field).string.len = 5]; } ```optional uint64 len = 19 [json_name = "len", (.buf.validate.priv.field) = { ... }- Specified by:
hasLenin interfaceStringRulesOrBuilder- Returns:
- Whether the len field is set.
-
getLen
public long getLen()`len` dictates that the field value must have the specified number of characters (Unicode code points), which may differ from the number of bytes in the string. If the field value does not meet the specified length, an error message will be generated. ```proto message MyString { // value length must be 5 characters string value = 1 [(buf.validate.field).string.len = 5]; } ```optional uint64 len = 19 [json_name = "len", (.buf.validate.priv.field) = { ... }- Specified by:
getLenin interfaceStringRulesOrBuilder- Returns:
- The len.
-
setLen
`len` dictates that the field value must have the specified number of characters (Unicode code points), which may differ from the number of bytes in the string. If the field value does not meet the specified length, an error message will be generated. ```proto message MyString { // value length must be 5 characters string value = 1 [(buf.validate.field).string.len = 5]; } ```optional uint64 len = 19 [json_name = "len", (.buf.validate.priv.field) = { ... }- Parameters:
value- The len to set.- Returns:
- This builder for chaining.
-
clearLen
`len` dictates that the field value must have the specified number of characters (Unicode code points), which may differ from the number of bytes in the string. If the field value does not meet the specified length, an error message will be generated. ```proto message MyString { // value length must be 5 characters string value = 1 [(buf.validate.field).string.len = 5]; } ```optional uint64 len = 19 [json_name = "len", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasMinLen
public boolean hasMinLen()`min_len` specifies that the field value must have at least the specified number of characters (Unicode code points), which may differ from the number of bytes in the string. If the field value contains fewer characters, an error message will be generated. ```proto message MyString { // value length must be at least 3 characters string value = 1 [(buf.validate.field).string.min_len = 3]; } ```optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... }- Specified by:
hasMinLenin interfaceStringRulesOrBuilder- Returns:
- Whether the minLen field is set.
-
getMinLen
public long getMinLen()`min_len` specifies that the field value must have at least the specified number of characters (Unicode code points), which may differ from the number of bytes in the string. If the field value contains fewer characters, an error message will be generated. ```proto message MyString { // value length must be at least 3 characters string value = 1 [(buf.validate.field).string.min_len = 3]; } ```optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... }- Specified by:
getMinLenin interfaceStringRulesOrBuilder- Returns:
- The minLen.
-
setMinLen
`min_len` specifies that the field value must have at least the specified number of characters (Unicode code points), which may differ from the number of bytes in the string. If the field value contains fewer characters, an error message will be generated. ```proto message MyString { // value length must be at least 3 characters string value = 1 [(buf.validate.field).string.min_len = 3]; } ```optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... }- Parameters:
value- The minLen to set.- Returns:
- This builder for chaining.
-
clearMinLen
`min_len` specifies that the field value must have at least the specified number of characters (Unicode code points), which may differ from the number of bytes in the string. If the field value contains fewer characters, an error message will be generated. ```proto message MyString { // value length must be at least 3 characters string value = 1 [(buf.validate.field).string.min_len = 3]; } ```optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasMaxLen
public boolean hasMaxLen()`max_len` specifies that the field value must have no more than the specified number of characters (Unicode code points), which may differ from the number of bytes in the string. If the field value contains more characters, an error message will be generated. ```proto message MyString { // value length must be at most 10 characters string value = 1 [(buf.validate.field).string.max_len = 10]; } ```optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... }- Specified by:
hasMaxLenin interfaceStringRulesOrBuilder- Returns:
- Whether the maxLen field is set.
-
getMaxLen
public long getMaxLen()`max_len` specifies that the field value must have no more than the specified number of characters (Unicode code points), which may differ from the number of bytes in the string. If the field value contains more characters, an error message will be generated. ```proto message MyString { // value length must be at most 10 characters string value = 1 [(buf.validate.field).string.max_len = 10]; } ```optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... }- Specified by:
getMaxLenin interfaceStringRulesOrBuilder- Returns:
- The maxLen.
-
setMaxLen
`max_len` specifies that the field value must have no more than the specified number of characters (Unicode code points), which may differ from the number of bytes in the string. If the field value contains more characters, an error message will be generated. ```proto message MyString { // value length must be at most 10 characters string value = 1 [(buf.validate.field).string.max_len = 10]; } ```optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... }- Parameters:
value- The maxLen to set.- Returns:
- This builder for chaining.
-
clearMaxLen
`max_len` specifies that the field value must have no more than the specified number of characters (Unicode code points), which may differ from the number of bytes in the string. If the field value contains more characters, an error message will be generated. ```proto message MyString { // value length must be at most 10 characters string value = 1 [(buf.validate.field).string.max_len = 10]; } ```optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasLenBytes
public boolean hasLenBytes()`len_bytes` dictates that the field value must have the specified number of bytes. If the field value does not match the specified length in bytes, an error message will be generated. ```proto message MyString { // value length must be 6 bytes string value = 1 [(buf.validate.field).string.len_bytes = 6]; } ```optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.priv.field) = { ... }- Specified by:
hasLenBytesin interfaceStringRulesOrBuilder- Returns:
- Whether the lenBytes field is set.
-
getLenBytes
public long getLenBytes()`len_bytes` dictates that the field value must have the specified number of bytes. If the field value does not match the specified length in bytes, an error message will be generated. ```proto message MyString { // value length must be 6 bytes string value = 1 [(buf.validate.field).string.len_bytes = 6]; } ```optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.priv.field) = { ... }- Specified by:
getLenBytesin interfaceStringRulesOrBuilder- Returns:
- The lenBytes.
-
setLenBytes
`len_bytes` dictates that the field value must have the specified number of bytes. If the field value does not match the specified length in bytes, an error message will be generated. ```proto message MyString { // value length must be 6 bytes string value = 1 [(buf.validate.field).string.len_bytes = 6]; } ```optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.priv.field) = { ... }- Parameters:
value- The lenBytes to set.- Returns:
- This builder for chaining.
-
clearLenBytes
`len_bytes` dictates that the field value must have the specified number of bytes. If the field value does not match the specified length in bytes, an error message will be generated. ```proto message MyString { // value length must be 6 bytes string value = 1 [(buf.validate.field).string.len_bytes = 6]; } ```optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasMinBytes
public boolean hasMinBytes()`min_bytes` specifies that the field value must have at least the specified number of bytes. If the field value contains fewer bytes, an error message will be generated. ```proto message MyString { // value length must be at least 4 bytes string value = 1 [(buf.validate.field).string.min_bytes = 4]; } ```optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.priv.field) = { ... }- Specified by:
hasMinBytesin interfaceStringRulesOrBuilder- Returns:
- Whether the minBytes field is set.
-
getMinBytes
public long getMinBytes()`min_bytes` specifies that the field value must have at least the specified number of bytes. If the field value contains fewer bytes, an error message will be generated. ```proto message MyString { // value length must be at least 4 bytes string value = 1 [(buf.validate.field).string.min_bytes = 4]; } ```optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.priv.field) = { ... }- Specified by:
getMinBytesin interfaceStringRulesOrBuilder- Returns:
- The minBytes.
-
setMinBytes
`min_bytes` specifies that the field value must have at least the specified number of bytes. If the field value contains fewer bytes, an error message will be generated. ```proto message MyString { // value length must be at least 4 bytes string value = 1 [(buf.validate.field).string.min_bytes = 4]; } ```optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.priv.field) = { ... }- Parameters:
value- The minBytes to set.- Returns:
- This builder for chaining.
-
clearMinBytes
`min_bytes` specifies that the field value must have at least the specified number of bytes. If the field value contains fewer bytes, an error message will be generated. ```proto message MyString { // value length must be at least 4 bytes string value = 1 [(buf.validate.field).string.min_bytes = 4]; } ```optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasMaxBytes
public boolean hasMaxBytes()`max_bytes` specifies that the field value must have no more than the specified number of bytes. If the field value contains more bytes, an error message will be generated. ```proto message MyString { // value length must be at most 8 bytes string value = 1 [(buf.validate.field).string.max_bytes = 8]; } ```optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.priv.field) = { ... }- Specified by:
hasMaxBytesin interfaceStringRulesOrBuilder- Returns:
- Whether the maxBytes field is set.
-
getMaxBytes
public long getMaxBytes()`max_bytes` specifies that the field value must have no more than the specified number of bytes. If the field value contains more bytes, an error message will be generated. ```proto message MyString { // value length must be at most 8 bytes string value = 1 [(buf.validate.field).string.max_bytes = 8]; } ```optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.priv.field) = { ... }- Specified by:
getMaxBytesin interfaceStringRulesOrBuilder- Returns:
- The maxBytes.
-
setMaxBytes
`max_bytes` specifies that the field value must have no more than the specified number of bytes. If the field value contains more bytes, an error message will be generated. ```proto message MyString { // value length must be at most 8 bytes string value = 1 [(buf.validate.field).string.max_bytes = 8]; } ```optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.priv.field) = { ... }- Parameters:
value- The maxBytes to set.- Returns:
- This builder for chaining.
-
clearMaxBytes
`max_bytes` specifies that the field value must have no more than the specified number of bytes. If the field value contains more bytes, an error message will be generated. ```proto message MyString { // value length must be at most 8 bytes string value = 1 [(buf.validate.field).string.max_bytes = 8]; } ```optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasPattern
public boolean hasPattern()`pattern` specifies that the field value must match the specified regular expression (RE2 syntax), with the expression provided without any delimiters. If the field value doesn't match the regular expression, an error message will be generated. ```proto message MyString { // value does not match regex pattern `^[a-zA-Z]//$` string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; } ```optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... }- Specified by:
hasPatternin interfaceStringRulesOrBuilder- Returns:
- Whether the pattern field is set.
-
getPattern
`pattern` specifies that the field value must match the specified regular expression (RE2 syntax), with the expression provided without any delimiters. If the field value doesn't match the regular expression, an error message will be generated. ```proto message MyString { // value does not match regex pattern `^[a-zA-Z]//$` string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; } ```optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... }- Specified by:
getPatternin interfaceStringRulesOrBuilder- Returns:
- The pattern.
-
getPatternBytes
public com.google.protobuf.ByteString getPatternBytes()`pattern` specifies that the field value must match the specified regular expression (RE2 syntax), with the expression provided without any delimiters. If the field value doesn't match the regular expression, an error message will be generated. ```proto message MyString { // value does not match regex pattern `^[a-zA-Z]//$` string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; } ```optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... }- Specified by:
getPatternBytesin interfaceStringRulesOrBuilder- Returns:
- The bytes for pattern.
-
setPattern
`pattern` specifies that the field value must match the specified regular expression (RE2 syntax), with the expression provided without any delimiters. If the field value doesn't match the regular expression, an error message will be generated. ```proto message MyString { // value does not match regex pattern `^[a-zA-Z]//$` string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; } ```optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... }- Parameters:
value- The pattern to set.- Returns:
- This builder for chaining.
-
clearPattern
`pattern` specifies that the field value must match the specified regular expression (RE2 syntax), with the expression provided without any delimiters. If the field value doesn't match the regular expression, an error message will be generated. ```proto message MyString { // value does not match regex pattern `^[a-zA-Z]//$` string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; } ```optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
setPatternBytes
`pattern` specifies that the field value must match the specified regular expression (RE2 syntax), with the expression provided without any delimiters. If the field value doesn't match the regular expression, an error message will be generated. ```proto message MyString { // value does not match regex pattern `^[a-zA-Z]//$` string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; } ```optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... }- Parameters:
value- The bytes for pattern to set.- Returns:
- This builder for chaining.
-
hasPrefix
public boolean hasPrefix()`prefix` specifies that the field value must have the specified substring at the beginning of the string. If the field value doesn't start with the specified prefix, an error message will be generated. ```proto message MyString { // value does not have prefix `pre` string value = 1 [(buf.validate.field).string.prefix = "pre"]; } ```optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... }- Specified by:
hasPrefixin interfaceStringRulesOrBuilder- Returns:
- Whether the prefix field is set.
-
getPrefix
`prefix` specifies that the field value must have the specified substring at the beginning of the string. If the field value doesn't start with the specified prefix, an error message will be generated. ```proto message MyString { // value does not have prefix `pre` string value = 1 [(buf.validate.field).string.prefix = "pre"]; } ```optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... }- Specified by:
getPrefixin interfaceStringRulesOrBuilder- Returns:
- The prefix.
-
getPrefixBytes
public com.google.protobuf.ByteString getPrefixBytes()`prefix` specifies that the field value must have the specified substring at the beginning of the string. If the field value doesn't start with the specified prefix, an error message will be generated. ```proto message MyString { // value does not have prefix `pre` string value = 1 [(buf.validate.field).string.prefix = "pre"]; } ```optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... }- Specified by:
getPrefixBytesin interfaceStringRulesOrBuilder- Returns:
- The bytes for prefix.
-
setPrefix
`prefix` specifies that the field value must have the specified substring at the beginning of the string. If the field value doesn't start with the specified prefix, an error message will be generated. ```proto message MyString { // value does not have prefix `pre` string value = 1 [(buf.validate.field).string.prefix = "pre"]; } ```optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... }- Parameters:
value- The prefix to set.- Returns:
- This builder for chaining.
-
clearPrefix
`prefix` specifies that the field value must have the specified substring at the beginning of the string. If the field value doesn't start with the specified prefix, an error message will be generated. ```proto message MyString { // value does not have prefix `pre` string value = 1 [(buf.validate.field).string.prefix = "pre"]; } ```optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
setPrefixBytes
`prefix` specifies that the field value must have the specified substring at the beginning of the string. If the field value doesn't start with the specified prefix, an error message will be generated. ```proto message MyString { // value does not have prefix `pre` string value = 1 [(buf.validate.field).string.prefix = "pre"]; } ```optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... }- Parameters:
value- The bytes for prefix to set.- Returns:
- This builder for chaining.
-
hasSuffix
public boolean hasSuffix()`suffix` specifies that the field value must have the specified substring at the end of the string. If the field value doesn't end with the specified suffix, an error message will be generated. ```proto message MyString { // value does not have suffix `post` string value = 1 [(buf.validate.field).string.suffix = "post"]; } ```optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... }- Specified by:
hasSuffixin interfaceStringRulesOrBuilder- Returns:
- Whether the suffix field is set.
-
getSuffix
`suffix` specifies that the field value must have the specified substring at the end of the string. If the field value doesn't end with the specified suffix, an error message will be generated. ```proto message MyString { // value does not have suffix `post` string value = 1 [(buf.validate.field).string.suffix = "post"]; } ```optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... }- Specified by:
getSuffixin interfaceStringRulesOrBuilder- Returns:
- The suffix.
-
getSuffixBytes
public com.google.protobuf.ByteString getSuffixBytes()`suffix` specifies that the field value must have the specified substring at the end of the string. If the field value doesn't end with the specified suffix, an error message will be generated. ```proto message MyString { // value does not have suffix `post` string value = 1 [(buf.validate.field).string.suffix = "post"]; } ```optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... }- Specified by:
getSuffixBytesin interfaceStringRulesOrBuilder- Returns:
- The bytes for suffix.
-
setSuffix
`suffix` specifies that the field value must have the specified substring at the end of the string. If the field value doesn't end with the specified suffix, an error message will be generated. ```proto message MyString { // value does not have suffix `post` string value = 1 [(buf.validate.field).string.suffix = "post"]; } ```optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... }- Parameters:
value- The suffix to set.- Returns:
- This builder for chaining.
-
clearSuffix
`suffix` specifies that the field value must have the specified substring at the end of the string. If the field value doesn't end with the specified suffix, an error message will be generated. ```proto message MyString { // value does not have suffix `post` string value = 1 [(buf.validate.field).string.suffix = "post"]; } ```optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
setSuffixBytes
`suffix` specifies that the field value must have the specified substring at the end of the string. If the field value doesn't end with the specified suffix, an error message will be generated. ```proto message MyString { // value does not have suffix `post` string value = 1 [(buf.validate.field).string.suffix = "post"]; } ```optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... }- Parameters:
value- The bytes for suffix to set.- Returns:
- This builder for chaining.
-
hasContains
public boolean hasContains()`contains` specifies that the field value must have the specified substring anywhere in the string. If the field value doesn't contain the specified substring, an error message will be generated. ```proto message MyString { // value does not contain substring `inside`. string value = 1 [(buf.validate.field).string.contains = "inside"]; } ```optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... }- Specified by:
hasContainsin interfaceStringRulesOrBuilder- Returns:
- Whether the contains field is set.
-
getContains
`contains` specifies that the field value must have the specified substring anywhere in the string. If the field value doesn't contain the specified substring, an error message will be generated. ```proto message MyString { // value does not contain substring `inside`. string value = 1 [(buf.validate.field).string.contains = "inside"]; } ```optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... }- Specified by:
getContainsin interfaceStringRulesOrBuilder- Returns:
- The contains.
-
getContainsBytes
public com.google.protobuf.ByteString getContainsBytes()`contains` specifies that the field value must have the specified substring anywhere in the string. If the field value doesn't contain the specified substring, an error message will be generated. ```proto message MyString { // value does not contain substring `inside`. string value = 1 [(buf.validate.field).string.contains = "inside"]; } ```optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... }- Specified by:
getContainsBytesin interfaceStringRulesOrBuilder- Returns:
- The bytes for contains.
-
setContains
`contains` specifies that the field value must have the specified substring anywhere in the string. If the field value doesn't contain the specified substring, an error message will be generated. ```proto message MyString { // value does not contain substring `inside`. string value = 1 [(buf.validate.field).string.contains = "inside"]; } ```optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... }- Parameters:
value- The contains to set.- Returns:
- This builder for chaining.
-
clearContains
`contains` specifies that the field value must have the specified substring anywhere in the string. If the field value doesn't contain the specified substring, an error message will be generated. ```proto message MyString { // value does not contain substring `inside`. string value = 1 [(buf.validate.field).string.contains = "inside"]; } ```optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
setContainsBytes
`contains` specifies that the field value must have the specified substring anywhere in the string. If the field value doesn't contain the specified substring, an error message will be generated. ```proto message MyString { // value does not contain substring `inside`. string value = 1 [(buf.validate.field).string.contains = "inside"]; } ```optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... }- Parameters:
value- The bytes for contains to set.- Returns:
- This builder for chaining.
-
hasNotContains
public boolean hasNotContains()`not_contains` specifies that the field value must not have the specified substring anywhere in the string. If the field value contains the specified substring, an error message will be generated. ```proto message MyString { // value contains substring `inside`. string value = 1 [(buf.validate.field).string.not_contains = "inside"]; } ```optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... }- Specified by:
hasNotContainsin interfaceStringRulesOrBuilder- Returns:
- Whether the notContains field is set.
-
getNotContains
`not_contains` specifies that the field value must not have the specified substring anywhere in the string. If the field value contains the specified substring, an error message will be generated. ```proto message MyString { // value contains substring `inside`. string value = 1 [(buf.validate.field).string.not_contains = "inside"]; } ```optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... }- Specified by:
getNotContainsin interfaceStringRulesOrBuilder- Returns:
- The notContains.
-
getNotContainsBytes
public com.google.protobuf.ByteString getNotContainsBytes()`not_contains` specifies that the field value must not have the specified substring anywhere in the string. If the field value contains the specified substring, an error message will be generated. ```proto message MyString { // value contains substring `inside`. string value = 1 [(buf.validate.field).string.not_contains = "inside"]; } ```optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... }- Specified by:
getNotContainsBytesin interfaceStringRulesOrBuilder- Returns:
- The bytes for notContains.
-
setNotContains
`not_contains` specifies that the field value must not have the specified substring anywhere in the string. If the field value contains the specified substring, an error message will be generated. ```proto message MyString { // value contains substring `inside`. string value = 1 [(buf.validate.field).string.not_contains = "inside"]; } ```optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... }- Parameters:
value- The notContains to set.- Returns:
- This builder for chaining.
-
clearNotContains
`not_contains` specifies that the field value must not have the specified substring anywhere in the string. If the field value contains the specified substring, an error message will be generated. ```proto message MyString { // value contains substring `inside`. string value = 1 [(buf.validate.field).string.not_contains = "inside"]; } ```optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
setNotContainsBytes
`not_contains` specifies that the field value must not have the specified substring anywhere in the string. If the field value contains the specified substring, an error message will be generated. ```proto message MyString { // value contains substring `inside`. string value = 1 [(buf.validate.field).string.not_contains = "inside"]; } ```optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... }- Parameters:
value- The bytes for notContains to set.- Returns:
- This builder for chaining.
-
getInList
public com.google.protobuf.ProtocolStringList getInList()`in` specifies that the field value must be equal to one of the specified values. If the field value isn't one of the specified values, an error message will be generated. ```proto message MyString { // value must be in list ["apple", "banana"] repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; } ```repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... }- Specified by:
getInListin interfaceStringRulesOrBuilder- Returns:
- A list containing the in.
-
getInCount
public int getInCount()`in` specifies that the field value must be equal to one of the specified values. If the field value isn't one of the specified values, an error message will be generated. ```proto message MyString { // value must be in list ["apple", "banana"] repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; } ```repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... }- Specified by:
getInCountin interfaceStringRulesOrBuilder- Returns:
- The count of in.
-
getIn
`in` specifies that the field value must be equal to one of the specified values. If the field value isn't one of the specified values, an error message will be generated. ```proto message MyString { // value must be in list ["apple", "banana"] repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; } ```repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... }- Specified by:
getInin interfaceStringRulesOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The in at the given index.
-
getInBytes
public com.google.protobuf.ByteString getInBytes(int index) `in` specifies that the field value must be equal to one of the specified values. If the field value isn't one of the specified values, an error message will be generated. ```proto message MyString { // value must be in list ["apple", "banana"] repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; } ```repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... }- Specified by:
getInBytesin interfaceStringRulesOrBuilder- Parameters:
index- The index of the value to return.- Returns:
- The bytes of the in at the given index.
-
setIn
`in` specifies that the field value must be equal to one of the specified values. If the field value isn't one of the specified values, an error message will be generated. ```proto message MyString { // value must be in list ["apple", "banana"] repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; } ```repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... }- Parameters:
index- The index to set the value at.value- The in to set.- Returns:
- This builder for chaining.
-
addIn
`in` specifies that the field value must be equal to one of the specified values. If the field value isn't one of the specified values, an error message will be generated. ```proto message MyString { // value must be in list ["apple", "banana"] repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; } ```repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... }- Parameters:
value- The in to add.- Returns:
- This builder for chaining.
-
addAllIn
`in` specifies that the field value must be equal to one of the specified values. If the field value isn't one of the specified values, an error message will be generated. ```proto message MyString { // value must be in list ["apple", "banana"] repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; } ```repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... }- Parameters:
values- The in to add.- Returns:
- This builder for chaining.
-
clearIn
`in` specifies that the field value must be equal to one of the specified values. If the field value isn't one of the specified values, an error message will be generated. ```proto message MyString { // value must be in list ["apple", "banana"] repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; } ```repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
addInBytes
`in` specifies that the field value must be equal to one of the specified values. If the field value isn't one of the specified values, an error message will be generated. ```proto message MyString { // value must be in list ["apple", "banana"] repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; } ```repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... }- Parameters:
value- The bytes of the in to add.- Returns:
- This builder for chaining.
-
getNotInList
public com.google.protobuf.ProtocolStringList getNotInList()`not_in` specifies that the field value cannot be equal to any of the specified values. If the field value is one of the specified values, an error message will be generated. ```proto message MyString { // value must not be in list ["orange", "grape"] repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; } ```repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... }- Specified by:
getNotInListin interfaceStringRulesOrBuilder- Returns:
- A list containing the notIn.
-
getNotInCount
public int getNotInCount()`not_in` specifies that the field value cannot be equal to any of the specified values. If the field value is one of the specified values, an error message will be generated. ```proto message MyString { // value must not be in list ["orange", "grape"] repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; } ```repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... }- Specified by:
getNotInCountin interfaceStringRulesOrBuilder- Returns:
- The count of notIn.
-
getNotIn
`not_in` specifies that the field value cannot be equal to any of the specified values. If the field value is one of the specified values, an error message will be generated. ```proto message MyString { // value must not be in list ["orange", "grape"] repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; } ```repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... }- Specified by:
getNotInin interfaceStringRulesOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The notIn at the given index.
-
getNotInBytes
public com.google.protobuf.ByteString getNotInBytes(int index) `not_in` specifies that the field value cannot be equal to any of the specified values. If the field value is one of the specified values, an error message will be generated. ```proto message MyString { // value must not be in list ["orange", "grape"] repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; } ```repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... }- Specified by:
getNotInBytesin interfaceStringRulesOrBuilder- Parameters:
index- The index of the value to return.- Returns:
- The bytes of the notIn at the given index.
-
setNotIn
`not_in` specifies that the field value cannot be equal to any of the specified values. If the field value is one of the specified values, an error message will be generated. ```proto message MyString { // value must not be in list ["orange", "grape"] repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; } ```repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... }- Parameters:
index- The index to set the value at.value- The notIn to set.- Returns:
- This builder for chaining.
-
addNotIn
`not_in` specifies that the field value cannot be equal to any of the specified values. If the field value is one of the specified values, an error message will be generated. ```proto message MyString { // value must not be in list ["orange", "grape"] repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; } ```repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... }- Parameters:
value- The notIn to add.- Returns:
- This builder for chaining.
-
addAllNotIn
`not_in` specifies that the field value cannot be equal to any of the specified values. If the field value is one of the specified values, an error message will be generated. ```proto message MyString { // value must not be in list ["orange", "grape"] repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; } ```repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... }- Parameters:
values- The notIn to add.- Returns:
- This builder for chaining.
-
clearNotIn
`not_in` specifies that the field value cannot be equal to any of the specified values. If the field value is one of the specified values, an error message will be generated. ```proto message MyString { // value must not be in list ["orange", "grape"] repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; } ```repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
addNotInBytes
`not_in` specifies that the field value cannot be equal to any of the specified values. If the field value is one of the specified values, an error message will be generated. ```proto message MyString { // value must not be in list ["orange", "grape"] repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; } ```repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... }- Parameters:
value- The bytes of the notIn to add.- Returns:
- This builder for chaining.
-
hasEmail
public boolean hasEmail()`email` specifies that the field value must be a valid email address (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1). If the field value isn't a valid email address, an error message will be generated. ```proto message MyString { // value must be a valid email address string value = 1 [(buf.validate.field).string.email = true]; } ```bool email = 12 [json_name = "email", (.buf.validate.priv.field) = { ... }- Specified by:
hasEmailin interfaceStringRulesOrBuilder- Returns:
- Whether the email field is set.
-
getEmail
public boolean getEmail()`email` specifies that the field value must be a valid email address (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1). If the field value isn't a valid email address, an error message will be generated. ```proto message MyString { // value must be a valid email address string value = 1 [(buf.validate.field).string.email = true]; } ```bool email = 12 [json_name = "email", (.buf.validate.priv.field) = { ... }- Specified by:
getEmailin interfaceStringRulesOrBuilder- Returns:
- The email.
-
setEmail
`email` specifies that the field value must be a valid email address (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1). If the field value isn't a valid email address, an error message will be generated. ```proto message MyString { // value must be a valid email address string value = 1 [(buf.validate.field).string.email = true]; } ```bool email = 12 [json_name = "email", (.buf.validate.priv.field) = { ... }- Parameters:
value- The email to set.- Returns:
- This builder for chaining.
-
clearEmail
`email` specifies that the field value must be a valid email address (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1). If the field value isn't a valid email address, an error message will be generated. ```proto message MyString { // value must be a valid email address string value = 1 [(buf.validate.field).string.email = true]; } ```bool email = 12 [json_name = "email", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasHostname
public boolean hasHostname()`hostname` specifies that the field value must be a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support internationalized domain names (IDNs). If the field value isn't a valid hostname, an error message will be generated. ```proto message MyString { // value must be a valid hostname string value = 1 [(buf.validate.field).string.hostname = true]; } ```bool hostname = 13 [json_name = "hostname", (.buf.validate.priv.field) = { ... }- Specified by:
hasHostnamein interfaceStringRulesOrBuilder- Returns:
- Whether the hostname field is set.
-
getHostname
public boolean getHostname()`hostname` specifies that the field value must be a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support internationalized domain names (IDNs). If the field value isn't a valid hostname, an error message will be generated. ```proto message MyString { // value must be a valid hostname string value = 1 [(buf.validate.field).string.hostname = true]; } ```bool hostname = 13 [json_name = "hostname", (.buf.validate.priv.field) = { ... }- Specified by:
getHostnamein interfaceStringRulesOrBuilder- Returns:
- The hostname.
-
setHostname
`hostname` specifies that the field value must be a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support internationalized domain names (IDNs). If the field value isn't a valid hostname, an error message will be generated. ```proto message MyString { // value must be a valid hostname string value = 1 [(buf.validate.field).string.hostname = true]; } ```bool hostname = 13 [json_name = "hostname", (.buf.validate.priv.field) = { ... }- Parameters:
value- The hostname to set.- Returns:
- This builder for chaining.
-
clearHostname
`hostname` specifies that the field value must be a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support internationalized domain names (IDNs). If the field value isn't a valid hostname, an error message will be generated. ```proto message MyString { // value must be a valid hostname string value = 1 [(buf.validate.field).string.hostname = true]; } ```bool hostname = 13 [json_name = "hostname", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasIp
public boolean hasIp()`ip` specifies that the field value must be a valid IP (v4 or v6) address, without surrounding square brackets for IPv6 addresses. If the field value isn't a valid IP address, an error message will be generated. ```proto message MyString { // value must be a valid IP address string value = 1 [(buf.validate.field).string.ip = true]; } ```bool ip = 14 [json_name = "ip", (.buf.validate.priv.field) = { ... }- Specified by:
hasIpin interfaceStringRulesOrBuilder- Returns:
- Whether the ip field is set.
-
getIp
public boolean getIp()`ip` specifies that the field value must be a valid IP (v4 or v6) address, without surrounding square brackets for IPv6 addresses. If the field value isn't a valid IP address, an error message will be generated. ```proto message MyString { // value must be a valid IP address string value = 1 [(buf.validate.field).string.ip = true]; } ```bool ip = 14 [json_name = "ip", (.buf.validate.priv.field) = { ... }- Specified by:
getIpin interfaceStringRulesOrBuilder- Returns:
- The ip.
-
setIp
`ip` specifies that the field value must be a valid IP (v4 or v6) address, without surrounding square brackets for IPv6 addresses. If the field value isn't a valid IP address, an error message will be generated. ```proto message MyString { // value must be a valid IP address string value = 1 [(buf.validate.field).string.ip = true]; } ```bool ip = 14 [json_name = "ip", (.buf.validate.priv.field) = { ... }- Parameters:
value- The ip to set.- Returns:
- This builder for chaining.
-
clearIp
`ip` specifies that the field value must be a valid IP (v4 or v6) address, without surrounding square brackets for IPv6 addresses. If the field value isn't a valid IP address, an error message will be generated. ```proto message MyString { // value must be a valid IP address string value = 1 [(buf.validate.field).string.ip = true]; } ```bool ip = 14 [json_name = "ip", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasIpv4
public boolean hasIpv4()`ipv4` specifies that the field value must be a valid IPv4 address. If the field value isn't a valid IPv4 address, an error message will be generated. ```proto message MyString { // value must be a valid IPv4 address string value = 1 [(buf.validate.field).string.ipv4 = true]; } ```bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.priv.field) = { ... }- Specified by:
hasIpv4in interfaceStringRulesOrBuilder- Returns:
- Whether the ipv4 field is set.
-
getIpv4
public boolean getIpv4()`ipv4` specifies that the field value must be a valid IPv4 address. If the field value isn't a valid IPv4 address, an error message will be generated. ```proto message MyString { // value must be a valid IPv4 address string value = 1 [(buf.validate.field).string.ipv4 = true]; } ```bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.priv.field) = { ... }- Specified by:
getIpv4in interfaceStringRulesOrBuilder- Returns:
- The ipv4.
-
setIpv4
`ipv4` specifies that the field value must be a valid IPv4 address. If the field value isn't a valid IPv4 address, an error message will be generated. ```proto message MyString { // value must be a valid IPv4 address string value = 1 [(buf.validate.field).string.ipv4 = true]; } ```bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.priv.field) = { ... }- Parameters:
value- The ipv4 to set.- Returns:
- This builder for chaining.
-
clearIpv4
`ipv4` specifies that the field value must be a valid IPv4 address. If the field value isn't a valid IPv4 address, an error message will be generated. ```proto message MyString { // value must be a valid IPv4 address string value = 1 [(buf.validate.field).string.ipv4 = true]; } ```bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasIpv6
public boolean hasIpv6()`ipv6` specifies that the field value must be a valid IPv6 address, without surrounding square brackets. If the field value is not a valid IPv6 address, an error message will be generated. ```proto message MyString { // value must be a valid IPv6 address string value = 1 [(buf.validate.field).string.ipv6 = true]; } ```bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.priv.field) = { ... }- Specified by:
hasIpv6in interfaceStringRulesOrBuilder- Returns:
- Whether the ipv6 field is set.
-
getIpv6
public boolean getIpv6()`ipv6` specifies that the field value must be a valid IPv6 address, without surrounding square brackets. If the field value is not a valid IPv6 address, an error message will be generated. ```proto message MyString { // value must be a valid IPv6 address string value = 1 [(buf.validate.field).string.ipv6 = true]; } ```bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.priv.field) = { ... }- Specified by:
getIpv6in interfaceStringRulesOrBuilder- Returns:
- The ipv6.
-
setIpv6
`ipv6` specifies that the field value must be a valid IPv6 address, without surrounding square brackets. If the field value is not a valid IPv6 address, an error message will be generated. ```proto message MyString { // value must be a valid IPv6 address string value = 1 [(buf.validate.field).string.ipv6 = true]; } ```bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.priv.field) = { ... }- Parameters:
value- The ipv6 to set.- Returns:
- This builder for chaining.
-
clearIpv6
`ipv6` specifies that the field value must be a valid IPv6 address, without surrounding square brackets. If the field value is not a valid IPv6 address, an error message will be generated. ```proto message MyString { // value must be a valid IPv6 address string value = 1 [(buf.validate.field).string.ipv6 = true]; } ```bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasUri
public boolean hasUri()`uri` specifies that the field value must be a valid, absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid, absolute URI, an error message will be generated. ```proto message MyString { // value must be a valid URI string value = 1 [(buf.validate.field).string.uri = true]; } ```bool uri = 17 [json_name = "uri", (.buf.validate.priv.field) = { ... }- Specified by:
hasUriin interfaceStringRulesOrBuilder- Returns:
- Whether the uri field is set.
-
getUri
public boolean getUri()`uri` specifies that the field value must be a valid, absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid, absolute URI, an error message will be generated. ```proto message MyString { // value must be a valid URI string value = 1 [(buf.validate.field).string.uri = true]; } ```bool uri = 17 [json_name = "uri", (.buf.validate.priv.field) = { ... }- Specified by:
getUriin interfaceStringRulesOrBuilder- Returns:
- The uri.
-
setUri
`uri` specifies that the field value must be a valid, absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid, absolute URI, an error message will be generated. ```proto message MyString { // value must be a valid URI string value = 1 [(buf.validate.field).string.uri = true]; } ```bool uri = 17 [json_name = "uri", (.buf.validate.priv.field) = { ... }- Parameters:
value- The uri to set.- Returns:
- This builder for chaining.
-
clearUri
`uri` specifies that the field value must be a valid, absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid, absolute URI, an error message will be generated. ```proto message MyString { // value must be a valid URI string value = 1 [(buf.validate.field).string.uri = true]; } ```bool uri = 17 [json_name = "uri", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasUriRef
public boolean hasUriRef()`uri_ref` specifies that the field value must be a valid URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the field value isn't a valid URI, an error message will be generated. ```proto message MyString { // value must be a valid URI string value = 1 [(buf.validate.field).string.uri_ref = true]; } ```bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.priv.field) = { ... }- Specified by:
hasUriRefin interfaceStringRulesOrBuilder- Returns:
- Whether the uriRef field is set.
-
getUriRef
public boolean getUriRef()`uri_ref` specifies that the field value must be a valid URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the field value isn't a valid URI, an error message will be generated. ```proto message MyString { // value must be a valid URI string value = 1 [(buf.validate.field).string.uri_ref = true]; } ```bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.priv.field) = { ... }- Specified by:
getUriRefin interfaceStringRulesOrBuilder- Returns:
- The uriRef.
-
setUriRef
`uri_ref` specifies that the field value must be a valid URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the field value isn't a valid URI, an error message will be generated. ```proto message MyString { // value must be a valid URI string value = 1 [(buf.validate.field).string.uri_ref = true]; } ```bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.priv.field) = { ... }- Parameters:
value- The uriRef to set.- Returns:
- This builder for chaining.
-
clearUriRef
`uri_ref` specifies that the field value must be a valid URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the field value isn't a valid URI, an error message will be generated. ```proto message MyString { // value must be a valid URI string value = 1 [(buf.validate.field).string.uri_ref = true]; } ```bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasAddress
public boolean hasAddress()`address` specifies that the field value must be either a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) (which doesn't support internationalized domain names or IDNs) or a valid IP (v4 or v6). If the field value isn't a valid hostname or IP, an error message will be generated. ```proto message MyString { // value must be a valid hostname, or ip address string value = 1 [(buf.validate.field).string.address = true]; } ```bool address = 21 [json_name = "address", (.buf.validate.priv.field) = { ... }- Specified by:
hasAddressin interfaceStringRulesOrBuilder- Returns:
- Whether the address field is set.
-
getAddress
public boolean getAddress()`address` specifies that the field value must be either a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) (which doesn't support internationalized domain names or IDNs) or a valid IP (v4 or v6). If the field value isn't a valid hostname or IP, an error message will be generated. ```proto message MyString { // value must be a valid hostname, or ip address string value = 1 [(buf.validate.field).string.address = true]; } ```bool address = 21 [json_name = "address", (.buf.validate.priv.field) = { ... }- Specified by:
getAddressin interfaceStringRulesOrBuilder- Returns:
- The address.
-
setAddress
`address` specifies that the field value must be either a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) (which doesn't support internationalized domain names or IDNs) or a valid IP (v4 or v6). If the field value isn't a valid hostname or IP, an error message will be generated. ```proto message MyString { // value must be a valid hostname, or ip address string value = 1 [(buf.validate.field).string.address = true]; } ```bool address = 21 [json_name = "address", (.buf.validate.priv.field) = { ... }- Parameters:
value- The address to set.- Returns:
- This builder for chaining.
-
clearAddress
`address` specifies that the field value must be either a valid hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) (which doesn't support internationalized domain names or IDNs) or a valid IP (v4 or v6). If the field value isn't a valid hostname or IP, an error message will be generated. ```proto message MyString { // value must be a valid hostname, or ip address string value = 1 [(buf.validate.field).string.address = true]; } ```bool address = 21 [json_name = "address", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasUuid
public boolean hasUuid()`uuid` specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the field value isn't a valid UUID, an error message will be generated. ```proto message MyString { // value must be a valid UUID string value = 1 [(buf.validate.field).string.uuid = true]; } ```bool uuid = 22 [json_name = "uuid", (.buf.validate.priv.field) = { ... }- Specified by:
hasUuidin interfaceStringRulesOrBuilder- Returns:
- Whether the uuid field is set.
-
getUuid
public boolean getUuid()`uuid` specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the field value isn't a valid UUID, an error message will be generated. ```proto message MyString { // value must be a valid UUID string value = 1 [(buf.validate.field).string.uuid = true]; } ```bool uuid = 22 [json_name = "uuid", (.buf.validate.priv.field) = { ... }- Specified by:
getUuidin interfaceStringRulesOrBuilder- Returns:
- The uuid.
-
setUuid
`uuid` specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the field value isn't a valid UUID, an error message will be generated. ```proto message MyString { // value must be a valid UUID string value = 1 [(buf.validate.field).string.uuid = true]; } ```bool uuid = 22 [json_name = "uuid", (.buf.validate.priv.field) = { ... }- Parameters:
value- The uuid to set.- Returns:
- This builder for chaining.
-
clearUuid
`uuid` specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the field value isn't a valid UUID, an error message will be generated. ```proto message MyString { // value must be a valid UUID string value = 1 [(buf.validate.field).string.uuid = true]; } ```bool uuid = 22 [json_name = "uuid", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasTuuid
public boolean hasTuuid()`tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2) with all dashes omitted. If the field value isn't a valid UUID without dashes, an error message will be generated. ```proto message MyString { // value must be a valid trimmed UUID string value = 1 [(buf.validate.field).string.tuuid = true]; } ```bool tuuid = 33 [json_name = "tuuid", (.buf.validate.priv.field) = { ... }- Specified by:
hasTuuidin interfaceStringRulesOrBuilder- Returns:
- Whether the tuuid field is set.
-
getTuuid
public boolean getTuuid()`tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2) with all dashes omitted. If the field value isn't a valid UUID without dashes, an error message will be generated. ```proto message MyString { // value must be a valid trimmed UUID string value = 1 [(buf.validate.field).string.tuuid = true]; } ```bool tuuid = 33 [json_name = "tuuid", (.buf.validate.priv.field) = { ... }- Specified by:
getTuuidin interfaceStringRulesOrBuilder- Returns:
- The tuuid.
-
setTuuid
`tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2) with all dashes omitted. If the field value isn't a valid UUID without dashes, an error message will be generated. ```proto message MyString { // value must be a valid trimmed UUID string value = 1 [(buf.validate.field).string.tuuid = true]; } ```bool tuuid = 33 [json_name = "tuuid", (.buf.validate.priv.field) = { ... }- Parameters:
value- The tuuid to set.- Returns:
- This builder for chaining.
-
clearTuuid
`tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2) with all dashes omitted. If the field value isn't a valid UUID without dashes, an error message will be generated. ```proto message MyString { // value must be a valid trimmed UUID string value = 1 [(buf.validate.field).string.tuuid = true]; } ```bool tuuid = 33 [json_name = "tuuid", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasIpWithPrefixlen
public boolean hasIpWithPrefixlen()`ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6) address with prefix length. If the field value isn't a valid IP with prefix length, an error message will be generated. ```proto message MyString { // value must be a valid IP with prefix length string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true]; } ```bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.priv.field) = { ... }- Specified by:
hasIpWithPrefixlenin interfaceStringRulesOrBuilder- Returns:
- Whether the ipWithPrefixlen field is set.
-
getIpWithPrefixlen
public boolean getIpWithPrefixlen()`ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6) address with prefix length. If the field value isn't a valid IP with prefix length, an error message will be generated. ```proto message MyString { // value must be a valid IP with prefix length string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true]; } ```bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.priv.field) = { ... }- Specified by:
getIpWithPrefixlenin interfaceStringRulesOrBuilder- Returns:
- The ipWithPrefixlen.
-
setIpWithPrefixlen
`ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6) address with prefix length. If the field value isn't a valid IP with prefix length, an error message will be generated. ```proto message MyString { // value must be a valid IP with prefix length string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true]; } ```bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.priv.field) = { ... }- Parameters:
value- The ipWithPrefixlen to set.- Returns:
- This builder for chaining.
-
clearIpWithPrefixlen
`ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6) address with prefix length. If the field value isn't a valid IP with prefix length, an error message will be generated. ```proto message MyString { // value must be a valid IP with prefix length string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true]; } ```bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasIpv4WithPrefixlen
public boolean hasIpv4WithPrefixlen()`ipv4_with_prefixlen` specifies that the field value must be a valid IPv4 address with prefix. If the field value isn't a valid IPv4 address with prefix length, an error message will be generated. ```proto message MyString { // value must be a valid IPv4 address with prefix length string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true]; } ```bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.priv.field) = { ... }- Specified by:
hasIpv4WithPrefixlenin interfaceStringRulesOrBuilder- Returns:
- Whether the ipv4WithPrefixlen field is set.
-
getIpv4WithPrefixlen
public boolean getIpv4WithPrefixlen()`ipv4_with_prefixlen` specifies that the field value must be a valid IPv4 address with prefix. If the field value isn't a valid IPv4 address with prefix length, an error message will be generated. ```proto message MyString { // value must be a valid IPv4 address with prefix length string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true]; } ```bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.priv.field) = { ... }- Specified by:
getIpv4WithPrefixlenin interfaceStringRulesOrBuilder- Returns:
- The ipv4WithPrefixlen.
-
setIpv4WithPrefixlen
`ipv4_with_prefixlen` specifies that the field value must be a valid IPv4 address with prefix. If the field value isn't a valid IPv4 address with prefix length, an error message will be generated. ```proto message MyString { // value must be a valid IPv4 address with prefix length string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true]; } ```bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.priv.field) = { ... }- Parameters:
value- The ipv4WithPrefixlen to set.- Returns:
- This builder for chaining.
-
clearIpv4WithPrefixlen
`ipv4_with_prefixlen` specifies that the field value must be a valid IPv4 address with prefix. If the field value isn't a valid IPv4 address with prefix length, an error message will be generated. ```proto message MyString { // value must be a valid IPv4 address with prefix length string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true]; } ```bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasIpv6WithPrefixlen
public boolean hasIpv6WithPrefixlen()`ipv6_with_prefixlen` specifies that the field value must be a valid IPv6 address with prefix length. If the field value is not a valid IPv6 address with prefix length, an error message will be generated. ```proto message MyString { // value must be a valid IPv6 address prefix length string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true]; } ```bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.priv.field) = { ... }- Specified by:
hasIpv6WithPrefixlenin interfaceStringRulesOrBuilder- Returns:
- Whether the ipv6WithPrefixlen field is set.
-
getIpv6WithPrefixlen
public boolean getIpv6WithPrefixlen()`ipv6_with_prefixlen` specifies that the field value must be a valid IPv6 address with prefix length. If the field value is not a valid IPv6 address with prefix length, an error message will be generated. ```proto message MyString { // value must be a valid IPv6 address prefix length string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true]; } ```bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.priv.field) = { ... }- Specified by:
getIpv6WithPrefixlenin interfaceStringRulesOrBuilder- Returns:
- The ipv6WithPrefixlen.
-
setIpv6WithPrefixlen
`ipv6_with_prefixlen` specifies that the field value must be a valid IPv6 address with prefix length. If the field value is not a valid IPv6 address with prefix length, an error message will be generated. ```proto message MyString { // value must be a valid IPv6 address prefix length string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true]; } ```bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.priv.field) = { ... }- Parameters:
value- The ipv6WithPrefixlen to set.- Returns:
- This builder for chaining.
-
clearIpv6WithPrefixlen
`ipv6_with_prefixlen` specifies that the field value must be a valid IPv6 address with prefix length. If the field value is not a valid IPv6 address with prefix length, an error message will be generated. ```proto message MyString { // value must be a valid IPv6 address prefix length string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true]; } ```bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasIpPrefix
public boolean hasIpPrefix()`ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix. If the field value isn't a valid IP prefix, an error message will be generated. The prefix must have all zeros for the masked bits of the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`). ```proto message MyString { // value must be a valid IP prefix string value = 1 [(buf.validate.field).string.ip_prefix = true]; } ```bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.priv.field) = { ... }- Specified by:
hasIpPrefixin interfaceStringRulesOrBuilder- Returns:
- Whether the ipPrefix field is set.
-
getIpPrefix
public boolean getIpPrefix()`ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix. If the field value isn't a valid IP prefix, an error message will be generated. The prefix must have all zeros for the masked bits of the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`). ```proto message MyString { // value must be a valid IP prefix string value = 1 [(buf.validate.field).string.ip_prefix = true]; } ```bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.priv.field) = { ... }- Specified by:
getIpPrefixin interfaceStringRulesOrBuilder- Returns:
- The ipPrefix.
-
setIpPrefix
`ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix. If the field value isn't a valid IP prefix, an error message will be generated. The prefix must have all zeros for the masked bits of the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`). ```proto message MyString { // value must be a valid IP prefix string value = 1 [(buf.validate.field).string.ip_prefix = true]; } ```bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.priv.field) = { ... }- Parameters:
value- The ipPrefix to set.- Returns:
- This builder for chaining.
-
clearIpPrefix
`ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix. If the field value isn't a valid IP prefix, an error message will be generated. The prefix must have all zeros for the masked bits of the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`). ```proto message MyString { // value must be a valid IP prefix string value = 1 [(buf.validate.field).string.ip_prefix = true]; } ```bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasIpv4Prefix
public boolean hasIpv4Prefix()`ipv4_prefix` specifies that the field value must be a valid IPv4 prefix. If the field value isn't a valid IPv4 prefix, an error message will be generated. The prefix must have all zeros for the masked bits of the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`). ```proto message MyString { // value must be a valid IPv4 prefix string value = 1 [(buf.validate.field).string.ipv4_prefix = true]; } ```bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.priv.field) = { ... }- Specified by:
hasIpv4Prefixin interfaceStringRulesOrBuilder- Returns:
- Whether the ipv4Prefix field is set.
-
getIpv4Prefix
public boolean getIpv4Prefix()`ipv4_prefix` specifies that the field value must be a valid IPv4 prefix. If the field value isn't a valid IPv4 prefix, an error message will be generated. The prefix must have all zeros for the masked bits of the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`). ```proto message MyString { // value must be a valid IPv4 prefix string value = 1 [(buf.validate.field).string.ipv4_prefix = true]; } ```bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.priv.field) = { ... }- Specified by:
getIpv4Prefixin interfaceStringRulesOrBuilder- Returns:
- The ipv4Prefix.
-
setIpv4Prefix
`ipv4_prefix` specifies that the field value must be a valid IPv4 prefix. If the field value isn't a valid IPv4 prefix, an error message will be generated. The prefix must have all zeros for the masked bits of the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`). ```proto message MyString { // value must be a valid IPv4 prefix string value = 1 [(buf.validate.field).string.ipv4_prefix = true]; } ```bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.priv.field) = { ... }- Parameters:
value- The ipv4Prefix to set.- Returns:
- This builder for chaining.
-
clearIpv4Prefix
`ipv4_prefix` specifies that the field value must be a valid IPv4 prefix. If the field value isn't a valid IPv4 prefix, an error message will be generated. The prefix must have all zeros for the masked bits of the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`). ```proto message MyString { // value must be a valid IPv4 prefix string value = 1 [(buf.validate.field).string.ipv4_prefix = true]; } ```bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasIpv6Prefix
public boolean hasIpv6Prefix()`ipv6_prefix` specifies that the field value must be a valid IPv6 prefix. If the field value is not a valid IPv6 prefix, an error message will be generated. The prefix must have all zeros for the masked bits of the prefix (e.g., `2001:db8::/48`, not `2001:db8::1/48`). ```proto message MyString { // value must be a valid IPv6 prefix string value = 1 [(buf.validate.field).string.ipv6_prefix = true]; } ```bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.priv.field) = { ... }- Specified by:
hasIpv6Prefixin interfaceStringRulesOrBuilder- Returns:
- Whether the ipv6Prefix field is set.
-
getIpv6Prefix
public boolean getIpv6Prefix()`ipv6_prefix` specifies that the field value must be a valid IPv6 prefix. If the field value is not a valid IPv6 prefix, an error message will be generated. The prefix must have all zeros for the masked bits of the prefix (e.g., `2001:db8::/48`, not `2001:db8::1/48`). ```proto message MyString { // value must be a valid IPv6 prefix string value = 1 [(buf.validate.field).string.ipv6_prefix = true]; } ```bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.priv.field) = { ... }- Specified by:
getIpv6Prefixin interfaceStringRulesOrBuilder- Returns:
- The ipv6Prefix.
-
setIpv6Prefix
`ipv6_prefix` specifies that the field value must be a valid IPv6 prefix. If the field value is not a valid IPv6 prefix, an error message will be generated. The prefix must have all zeros for the masked bits of the prefix (e.g., `2001:db8::/48`, not `2001:db8::1/48`). ```proto message MyString { // value must be a valid IPv6 prefix string value = 1 [(buf.validate.field).string.ipv6_prefix = true]; } ```bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.priv.field) = { ... }- Parameters:
value- The ipv6Prefix to set.- Returns:
- This builder for chaining.
-
clearIpv6Prefix
`ipv6_prefix` specifies that the field value must be a valid IPv6 prefix. If the field value is not a valid IPv6 prefix, an error message will be generated. The prefix must have all zeros for the masked bits of the prefix (e.g., `2001:db8::/48`, not `2001:db8::1/48`). ```proto message MyString { // value must be a valid IPv6 prefix string value = 1 [(buf.validate.field).string.ipv6_prefix = true]; } ```bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasHostAndPort
public boolean hasHostAndPort()`host_and_port` specifies the field value must be a valid host and port pair. The host must be a valid hostname or IP address while the port must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited with square brackets (e.g., `[::1]:1234`).
bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... }- Specified by:
hasHostAndPortin interfaceStringRulesOrBuilder- Returns:
- Whether the hostAndPort field is set.
-
getHostAndPort
public boolean getHostAndPort()`host_and_port` specifies the field value must be a valid host and port pair. The host must be a valid hostname or IP address while the port must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited with square brackets (e.g., `[::1]:1234`).
bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... }- Specified by:
getHostAndPortin interfaceStringRulesOrBuilder- Returns:
- The hostAndPort.
-
setHostAndPort
`host_and_port` specifies the field value must be a valid host and port pair. The host must be a valid hostname or IP address while the port must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited with square brackets (e.g., `[::1]:1234`).
bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... }- Parameters:
value- The hostAndPort to set.- Returns:
- This builder for chaining.
-
clearHostAndPort
`host_and_port` specifies the field value must be a valid host and port pair. The host must be a valid hostname or IP address while the port must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited with square brackets (e.g., `[::1]:1234`).
bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasWellKnownRegex
public boolean hasWellKnownRegex()`well_known_regex` specifies a common well-known pattern defined as a regex. If the field value doesn't match the well-known regex, an error message will be generated. ```proto message MyString { // value must be a valid HTTP header value string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE]; } ``` #### KnownRegex `well_known_regex` contains some well-known patterns. | Name | Number | Description | |-------------------------------|--------|-------------------------------------------| | KNOWN_REGEX_UNSPECIFIED | 0 | | | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) | | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |.buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... }- Specified by:
hasWellKnownRegexin interfaceStringRulesOrBuilder- Returns:
- Whether the wellKnownRegex field is set.
-
getWellKnownRegexValue
public int getWellKnownRegexValue()`well_known_regex` specifies a common well-known pattern defined as a regex. If the field value doesn't match the well-known regex, an error message will be generated. ```proto message MyString { // value must be a valid HTTP header value string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE]; } ``` #### KnownRegex `well_known_regex` contains some well-known patterns. | Name | Number | Description | |-------------------------------|--------|-------------------------------------------| | KNOWN_REGEX_UNSPECIFIED | 0 | | | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) | | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |.buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... }- Specified by:
getWellKnownRegexValuein interfaceStringRulesOrBuilder- Returns:
- The enum numeric value on the wire for wellKnownRegex.
-
setWellKnownRegexValue
`well_known_regex` specifies a common well-known pattern defined as a regex. If the field value doesn't match the well-known regex, an error message will be generated. ```proto message MyString { // value must be a valid HTTP header value string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE]; } ``` #### KnownRegex `well_known_regex` contains some well-known patterns. | Name | Number | Description | |-------------------------------|--------|-------------------------------------------| | KNOWN_REGEX_UNSPECIFIED | 0 | | | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) | | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |.buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... }- Parameters:
value- The enum numeric value on the wire for wellKnownRegex to set.- Returns:
- This builder for chaining.
-
getWellKnownRegex
`well_known_regex` specifies a common well-known pattern defined as a regex. If the field value doesn't match the well-known regex, an error message will be generated. ```proto message MyString { // value must be a valid HTTP header value string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE]; } ``` #### KnownRegex `well_known_regex` contains some well-known patterns. | Name | Number | Description | |-------------------------------|--------|-------------------------------------------| | KNOWN_REGEX_UNSPECIFIED | 0 | | | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) | | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |.buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... }- Specified by:
getWellKnownRegexin interfaceStringRulesOrBuilder- Returns:
- The wellKnownRegex.
-
setWellKnownRegex
`well_known_regex` specifies a common well-known pattern defined as a regex. If the field value doesn't match the well-known regex, an error message will be generated. ```proto message MyString { // value must be a valid HTTP header value string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE]; } ``` #### KnownRegex `well_known_regex` contains some well-known patterns. | Name | Number | Description | |-------------------------------|--------|-------------------------------------------| | KNOWN_REGEX_UNSPECIFIED | 0 | | | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) | | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |.buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... }- Parameters:
value- The wellKnownRegex to set.- Returns:
- This builder for chaining.
-
clearWellKnownRegex
`well_known_regex` specifies a common well-known pattern defined as a regex. If the field value doesn't match the well-known regex, an error message will be generated. ```proto message MyString { // value must be a valid HTTP header value string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE]; } ``` #### KnownRegex `well_known_regex` contains some well-known patterns. | Name | Number | Description | |-------------------------------|--------|-------------------------------------------| | KNOWN_REGEX_UNSPECIFIED | 0 | | | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) | | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |.buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... }- Returns:
- This builder for chaining.
-
hasStrict
public boolean hasStrict()This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to enable strict header validation. By default, this is true, and HTTP header validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser validations that only disallow `\r\n\0` characters, which can be used to bypass header matching rules. ```proto message MyString { // The field `value` must have be a valid HTTP headers, but not enforced with strict rules. string value = 1 [(buf.validate.field).string.strict = false]; } ```optional bool strict = 25 [json_name = "strict"];- Specified by:
hasStrictin interfaceStringRulesOrBuilder- Returns:
- Whether the strict field is set.
-
getStrict
public boolean getStrict()This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to enable strict header validation. By default, this is true, and HTTP header validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser validations that only disallow `\r\n\0` characters, which can be used to bypass header matching rules. ```proto message MyString { // The field `value` must have be a valid HTTP headers, but not enforced with strict rules. string value = 1 [(buf.validate.field).string.strict = false]; } ```optional bool strict = 25 [json_name = "strict"];- Specified by:
getStrictin interfaceStringRulesOrBuilder- Returns:
- The strict.
-
setStrict
This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to enable strict header validation. By default, this is true, and HTTP header validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser validations that only disallow `\r\n\0` characters, which can be used to bypass header matching rules. ```proto message MyString { // The field `value` must have be a valid HTTP headers, but not enforced with strict rules. string value = 1 [(buf.validate.field).string.strict = false]; } ```optional bool strict = 25 [json_name = "strict"];- Parameters:
value- The strict to set.- Returns:
- This builder for chaining.
-
clearStrict
This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to enable strict header validation. By default, this is true, and HTTP header validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser validations that only disallow `\r\n\0` characters, which can be used to bypass header matching rules. ```proto message MyString { // The field `value` must have be a valid HTTP headers, but not enforced with strict rules. string value = 1 [(buf.validate.field).string.strict = false]; } ```optional bool strict = 25 [json_name = "strict"];- Returns:
- This builder for chaining.
-