Package build.buf.validate
Class BytesRules
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
build.buf.validate.BytesRules
- All Implemented Interfaces:
BytesRulesOrBuilder,com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Serializable
public final class BytesRules
extends com.google.protobuf.GeneratedMessageV3
implements BytesRulesOrBuilder
BytesRules describe the constraints applied to `bytes` values. These rules may also be applied to the `google.protobuf.BytesValue` Well-Known-Type.Protobuf type
buf.validate.BytesRules- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBytesRules describe the constraints applied to `bytes` values.static enumNested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageV3
alwaysUseFieldBuilders, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleancom.google.protobuf.ByteStringgetConst()`const` requires the field value to exactly match the specified bytes value.com.google.protobuf.ByteString`contains` requires the field value to have the specified bytes anywhere in the string.static BytesRulesstatic final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.ByteStringgetIn(int index) `in` requires the field value to be equal to one of the specified values.int`in` requires the field value to be equal to one of the specified values.List<com.google.protobuf.ByteString>`in` requires the field value to be equal to one of the specified values.booleangetIp()`ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.booleangetIpv4()`ipv4` ensures that the field `value` is a valid IPv4 address in byte format.booleangetIpv6()`ipv6` ensures that the field `value` is a valid IPv6 address in byte format.longgetLen()`len` requires the field value to have the specified length in bytes.long`max_len` requires the field value to have at most the specified maximum length in bytes.long`min_len` requires the field value to have at least the specified minimum length in bytes.com.google.protobuf.ByteStringgetNotIn(int index) `not_in` requires the field value to be not equal to any of the specified values.int`not_in` requires the field value to be not equal to any of the specified values.List<com.google.protobuf.ByteString>`not_in` requires the field value to be not equal to any of the specified values.com.google.protobuf.Parser<BytesRules>`pattern` requires the field value to match the specified regular expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).com.google.protobuf.ByteString`pattern` requires the field value to match the specified regular expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).com.google.protobuf.ByteString`prefix` requires the field value to have the specified bytes at the beginning of the string.intcom.google.protobuf.ByteString`suffix` requires the field value to have the specified bytes at the end of the string.booleanhasConst()`const` requires the field value to exactly match the specified bytes value.boolean`contains` requires the field value to have the specified bytes anywhere in the string.inthashCode()booleanhasIp()`ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.booleanhasIpv4()`ipv4` ensures that the field `value` is a valid IPv4 address in byte format.booleanhasIpv6()`ipv6` ensures that the field `value` is a valid IPv6 address in byte format.booleanhasLen()`len` requires the field value to have the specified length in bytes.boolean`max_len` requires the field value to have at most the specified maximum length in bytes.boolean`min_len` requires the field value to have at least the specified minimum length in bytes.boolean`pattern` requires the field value to match the specified regular expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).boolean`prefix` requires the field value to have the specified bytes at the beginning of the string.boolean`suffix` requires the field value to have the specified bytes at the end of the string.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanstatic BytesRules.Builderstatic BytesRules.BuildernewBuilder(BytesRules prototype) protected BytesRules.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) static BytesRulesparseDelimitedFrom(InputStream input) static BytesRulesparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static BytesRulesparseFrom(byte[] data) static BytesRulesparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static BytesRulesparseFrom(com.google.protobuf.ByteString data) static BytesRulesparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static BytesRulesparseFrom(com.google.protobuf.CodedInputStream input) static BytesRulesparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static BytesRulesparseFrom(InputStream input) static BytesRulesparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static BytesRulesparseFrom(ByteBuffer data) static BytesRulesparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<BytesRules>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
CONST_FIELD_NUMBER
public static final int CONST_FIELD_NUMBER- See Also:
-
LEN_FIELD_NUMBER
public static final int LEN_FIELD_NUMBER- See Also:
-
MIN_LEN_FIELD_NUMBER
public static final int MIN_LEN_FIELD_NUMBER- See Also:
-
MAX_LEN_FIELD_NUMBER
public static final int MAX_LEN_FIELD_NUMBER- See Also:
-
PATTERN_FIELD_NUMBER
public static final int PATTERN_FIELD_NUMBER- See Also:
-
PREFIX_FIELD_NUMBER
public static final int PREFIX_FIELD_NUMBER- See Also:
-
SUFFIX_FIELD_NUMBER
public static final int SUFFIX_FIELD_NUMBER- See Also:
-
CONTAINS_FIELD_NUMBER
public static final int CONTAINS_FIELD_NUMBER- See Also:
-
IN_FIELD_NUMBER
public static final int IN_FIELD_NUMBER- See Also:
-
NOT_IN_FIELD_NUMBER
public static final int NOT_IN_FIELD_NUMBER- See Also:
-
IP_FIELD_NUMBER
public static final int IP_FIELD_NUMBER- See Also:
-
IPV4_FIELD_NUMBER
public static final int IPV4_FIELD_NUMBER- See Also:
-
IPV6_FIELD_NUMBER
public static final int IPV6_FIELD_NUMBER- See Also:
-
-
Method Details
-
newInstance
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3
-
getWellKnownCase
- Specified by:
getWellKnownCasein interfaceBytesRulesOrBuilder
-
hasConst
public boolean hasConst()`const` requires the field value to exactly match the specified bytes value. If the field value doesn't match, an error message is generated. ```proto message MyBytes { // value must be "\x01\x02\x03\x04" bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"]; } ```optional bytes const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... }- Specified by:
hasConstin interfaceBytesRulesOrBuilder- Returns:
- Whether the const field is set.
-
getConst
public com.google.protobuf.ByteString getConst()`const` requires the field value to exactly match the specified bytes value. If the field value doesn't match, an error message is generated. ```proto message MyBytes { // value must be "\x01\x02\x03\x04" bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"]; } ```optional bytes const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... }- Specified by:
getConstin interfaceBytesRulesOrBuilder- Returns:
- The const.
-
hasLen
public boolean hasLen()`len` requires the field value to have the specified length in bytes. If the field value doesn't match, an error message is generated. ```proto message MyBytes { // value length must be 4 bytes. optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; } ```optional uint64 len = 13 [json_name = "len", (.buf.validate.priv.field) = { ... }- Specified by:
hasLenin interfaceBytesRulesOrBuilder- Returns:
- Whether the len field is set.
-
getLen
public long getLen()`len` requires the field value to have the specified length in bytes. If the field value doesn't match, an error message is generated. ```proto message MyBytes { // value length must be 4 bytes. optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; } ```optional uint64 len = 13 [json_name = "len", (.buf.validate.priv.field) = { ... }- Specified by:
getLenin interfaceBytesRulesOrBuilder- Returns:
- The len.
-
hasMinLen
public boolean hasMinLen()`min_len` requires the field value to have at least the specified minimum length in bytes. If the field value doesn't meet the requirement, an error message is generated. ```proto message MyBytes { // value length must be at least 2 bytes. optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; } ```optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... }- Specified by:
hasMinLenin interfaceBytesRulesOrBuilder- Returns:
- Whether the minLen field is set.
-
getMinLen
public long getMinLen()`min_len` requires the field value to have at least the specified minimum length in bytes. If the field value doesn't meet the requirement, an error message is generated. ```proto message MyBytes { // value length must be at least 2 bytes. optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; } ```optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... }- Specified by:
getMinLenin interfaceBytesRulesOrBuilder- Returns:
- The minLen.
-
hasMaxLen
public boolean hasMaxLen()`max_len` requires the field value to have at most the specified maximum length in bytes. If the field value exceeds the requirement, an error message is generated. ```proto message MyBytes { // value must be at most 6 bytes. optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; } ```optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... }- Specified by:
hasMaxLenin interfaceBytesRulesOrBuilder- Returns:
- Whether the maxLen field is set.
-
getMaxLen
public long getMaxLen()`max_len` requires the field value to have at most the specified maximum length in bytes. If the field value exceeds the requirement, an error message is generated. ```proto message MyBytes { // value must be at most 6 bytes. optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; } ```optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... }- Specified by:
getMaxLenin interfaceBytesRulesOrBuilder- Returns:
- The maxLen.
-
hasPattern
public boolean hasPattern()`pattern` requires the field value to match the specified regular expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). The value of the field must be valid UTF-8 or validation will fail with a runtime error. If the field value doesn't match the pattern, an error message is generated. ```proto message MyBytes { // value must match regex pattern "^[a-zA-Z0-9]+$". optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; } ```optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { ... }- Specified by:
hasPatternin interfaceBytesRulesOrBuilder- Returns:
- Whether the pattern field is set.
-
getPattern
`pattern` requires the field value to match the specified regular expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). The value of the field must be valid UTF-8 or validation will fail with a runtime error. If the field value doesn't match the pattern, an error message is generated. ```proto message MyBytes { // value must match regex pattern "^[a-zA-Z0-9]+$". optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; } ```optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { ... }- Specified by:
getPatternin interfaceBytesRulesOrBuilder- Returns:
- The pattern.
-
getPatternBytes
public com.google.protobuf.ByteString getPatternBytes()`pattern` requires the field value to match the specified regular expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). The value of the field must be valid UTF-8 or validation will fail with a runtime error. If the field value doesn't match the pattern, an error message is generated. ```proto message MyBytes { // value must match regex pattern "^[a-zA-Z0-9]+$". optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; } ```optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { ... }- Specified by:
getPatternBytesin interfaceBytesRulesOrBuilder- Returns:
- The bytes for pattern.
-
hasPrefix
public boolean hasPrefix()`prefix` requires the field value to have the specified bytes at the beginning of the string. If the field value doesn't meet the requirement, an error message is generated. ```proto message MyBytes { // value does not have prefix \x01\x02 optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; } ```optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.priv.field) = { ... }- Specified by:
hasPrefixin interfaceBytesRulesOrBuilder- Returns:
- Whether the prefix field is set.
-
getPrefix
public com.google.protobuf.ByteString getPrefix()`prefix` requires the field value to have the specified bytes at the beginning of the string. If the field value doesn't meet the requirement, an error message is generated. ```proto message MyBytes { // value does not have prefix \x01\x02 optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; } ```optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.priv.field) = { ... }- Specified by:
getPrefixin interfaceBytesRulesOrBuilder- Returns:
- The prefix.
-
hasSuffix
public boolean hasSuffix()`suffix` requires the field value to have the specified bytes at the end of the string. If the field value doesn't meet the requirement, an error message is generated. ```proto message MyBytes { // value does not have suffix \x03\x04 optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; } ```optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.priv.field) = { ... }- Specified by:
hasSuffixin interfaceBytesRulesOrBuilder- Returns:
- Whether the suffix field is set.
-
getSuffix
public com.google.protobuf.ByteString getSuffix()`suffix` requires the field value to have the specified bytes at the end of the string. If the field value doesn't meet the requirement, an error message is generated. ```proto message MyBytes { // value does not have suffix \x03\x04 optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; } ```optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.priv.field) = { ... }- Specified by:
getSuffixin interfaceBytesRulesOrBuilder- Returns:
- The suffix.
-
hasContains
public boolean hasContains()`contains` requires the field value to have the specified bytes anywhere in the string. If the field value doesn't meet the requirement, an error message is generated. ```protobuf message MyBytes { // value does not contain \x02\x03 optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; } ```optional bytes contains = 7 [json_name = "contains", (.buf.validate.priv.field) = { ... }- Specified by:
hasContainsin interfaceBytesRulesOrBuilder- Returns:
- Whether the contains field is set.
-
getContains
public com.google.protobuf.ByteString getContains()`contains` requires the field value to have the specified bytes anywhere in the string. If the field value doesn't meet the requirement, an error message is generated. ```protobuf message MyBytes { // value does not contain \x02\x03 optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; } ```optional bytes contains = 7 [json_name = "contains", (.buf.validate.priv.field) = { ... }- Specified by:
getContainsin interfaceBytesRulesOrBuilder- Returns:
- The contains.
-
getInList
`in` requires the field value to be equal to one of the specified values. If the field value doesn't match any of the specified values, an error message is generated. ```protobuf message MyBytes { // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; } ```repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... }- Specified by:
getInListin interfaceBytesRulesOrBuilder- Returns:
- A list containing the in.
-
getInCount
public int getInCount()`in` requires the field value to be equal to one of the specified values. If the field value doesn't match any of the specified values, an error message is generated. ```protobuf message MyBytes { // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; } ```repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... }- Specified by:
getInCountin interfaceBytesRulesOrBuilder- Returns:
- The count of in.
-
getIn
public com.google.protobuf.ByteString getIn(int index) `in` requires the field value to be equal to one of the specified values. If the field value doesn't match any of the specified values, an error message is generated. ```protobuf message MyBytes { // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; } ```repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... }- Specified by:
getInin interfaceBytesRulesOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The in at the given index.
-
getNotInList
`not_in` requires the field value to be not equal to any of the specified values. If the field value matches any of the specified values, an error message is generated. ```proto message MyBytes { // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; } ```repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... }- Specified by:
getNotInListin interfaceBytesRulesOrBuilder- Returns:
- A list containing the notIn.
-
getNotInCount
public int getNotInCount()`not_in` requires the field value to be not equal to any of the specified values. If the field value matches any of the specified values, an error message is generated. ```proto message MyBytes { // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; } ```repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... }- Specified by:
getNotInCountin interfaceBytesRulesOrBuilder- Returns:
- The count of notIn.
-
getNotIn
public com.google.protobuf.ByteString getNotIn(int index) `not_in` requires the field value to be not equal to any of the specified values. If the field value matches any of the specified values, an error message is generated. ```proto message MyBytes { // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; } ```repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... }- Specified by:
getNotInin interfaceBytesRulesOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The notIn at the given index.
-
hasIp
public boolean hasIp()`ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format. If the field value doesn't meet this constraint, an error message is generated. ```proto message MyBytes { // value must be a valid IP address optional bytes value = 1 [(buf.validate.field).bytes.ip = true]; } ```bool ip = 10 [json_name = "ip", (.buf.validate.priv.field) = { ... }- Specified by:
hasIpin interfaceBytesRulesOrBuilder- Returns:
- Whether the ip field is set.
-
getIp
public boolean getIp()`ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format. If the field value doesn't meet this constraint, an error message is generated. ```proto message MyBytes { // value must be a valid IP address optional bytes value = 1 [(buf.validate.field).bytes.ip = true]; } ```bool ip = 10 [json_name = "ip", (.buf.validate.priv.field) = { ... }- Specified by:
getIpin interfaceBytesRulesOrBuilder- Returns:
- The ip.
-
hasIpv4
public boolean hasIpv4()`ipv4` ensures that the field `value` is a valid IPv4 address in byte format. If the field value doesn't meet this constraint, an error message is generated. ```proto message MyBytes { // value must be a valid IPv4 address optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true]; } ```bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.priv.field) = { ... }- Specified by:
hasIpv4in interfaceBytesRulesOrBuilder- Returns:
- Whether the ipv4 field is set.
-
getIpv4
public boolean getIpv4()`ipv4` ensures that the field `value` is a valid IPv4 address in byte format. If the field value doesn't meet this constraint, an error message is generated. ```proto message MyBytes { // value must be a valid IPv4 address optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true]; } ```bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.priv.field) = { ... }- Specified by:
getIpv4in interfaceBytesRulesOrBuilder- Returns:
- The ipv4.
-
hasIpv6
public boolean hasIpv6()`ipv6` ensures that the field `value` is a valid IPv6 address in byte format. If the field value doesn't meet this constraint, an error message is generated. ```proto message MyBytes { // value must be a valid IPv6 address optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true]; } ```bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.priv.field) = { ... }- Specified by:
hasIpv6in interfaceBytesRulesOrBuilder- Returns:
- Whether the ipv6 field is set.
-
getIpv6
public boolean getIpv6()`ipv6` ensures that the field `value` is a valid IPv6 address in byte format. If the field value doesn't meet this constraint, an error message is generated. ```proto message MyBytes { // value must be a valid IPv6 address optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true]; } ```bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.priv.field) = { ... }- Specified by:
getIpv6in interfaceBytesRulesOrBuilder- Returns:
- The ipv6.
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static BytesRules parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static BytesRules parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static BytesRules parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static BytesRules parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static BytesRules parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static BytesRules parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static BytesRules parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static BytesRules parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static BytesRules parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected BytesRules.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) - Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-