public interface BytesRulesOrBuilder
extends com.google.protobuf.MessageOrBuilder
| Modifier and Type | Method and Description |
|---|---|
com.google.protobuf.ByteString |
getConst()
`const` requires the field value to exactly match the specified bytes
value.
|
com.google.protobuf.ByteString |
getContains()
`contains` requires the field value to have the specified bytes anywhere in
the string.
|
com.google.protobuf.ByteString |
getIn(int index)
`in` requires the field value to be equal to one of the specified
values.
|
int |
getInCount()
`in` requires the field value to be equal to one of the specified
values.
|
List<com.google.protobuf.ByteString> |
getInList()
`in` requires the field value to be equal to one of the specified
values.
|
boolean |
getIp()
`ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
|
boolean |
getIpv4()
`ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
|
boolean |
getIpv6()
`ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
|
long |
getLen()
`len` requires the field value to have the specified length in bytes.
|
long |
getMaxLen()
`max_len` requires the field value to have at most the specified maximum
length in bytes.
|
long |
getMinLen()
`min_len` requires the field value to have at least the specified minimum
length in bytes.
|
com.google.protobuf.ByteString |
getNotIn(int index)
`not_in` requires the field value to be not equal to any of the specified
values.
|
int |
getNotInCount()
`not_in` requires the field value to be not equal to any of the specified
values.
|
List<com.google.protobuf.ByteString> |
getNotInList()
`not_in` requires the field value to be not equal to any of the specified
values.
|
String |
getPattern()
`pattern` requires the field value to match the specified regular
expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
|
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)).
|
com.google.protobuf.ByteString |
getPrefix()
`prefix` requires the field value to have the specified bytes at the
beginning of the string.
|
com.google.protobuf.ByteString |
getSuffix()
`suffix` requires the field value to have the specified bytes at the end
of the string.
|
BytesRules.WellKnownCase |
getWellKnownCase() |
boolean |
hasConst()
`const` requires the field value to exactly match the specified bytes
value.
|
boolean |
hasContains()
`contains` requires the field value to have the specified bytes anywhere in
the string.
|
boolean |
hasIp()
`ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
|
boolean |
hasIpv4()
`ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
|
boolean |
hasIpv6()
`ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
|
boolean |
hasLen()
`len` requires the field value to have the specified length in bytes.
|
boolean |
hasMaxLen()
`max_len` requires the field value to have at most the specified maximum
length in bytes.
|
boolean |
hasMinLen()
`min_len` requires the field value to have at least the specified minimum
length in bytes.
|
boolean |
hasPattern()
`pattern` requires the field value to match the specified regular
expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
|
boolean |
hasPrefix()
`prefix` requires the field value to have the specified bytes at the
beginning of the string.
|
boolean |
hasSuffix()
`suffix` requires the field value to have the specified bytes at the end
of the string.
|
findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneofboolean 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) = { ... }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) = { ... }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) = { ... }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) = { ... }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) = { ... }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) = { ... }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) = { ... }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) = { ... }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) = { ... }String 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) = { ... }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) = { ... }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) = { ... }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) = { ... }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) = { ... }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) = { ... }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) = { ... }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) = { ... }List<com.google.protobuf.ByteString> 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) = { ... }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) = { ... }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) = { ... }index - The index of the element to return.List<com.google.protobuf.ByteString> 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) = { ... }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) = { ... }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) = { ... }index - The index of the element to return.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) = { ... }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) = { ... }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) = { ... }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) = { ... }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) = { ... }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) = { ... }BytesRules.WellKnownCase getWellKnownCase()
Copyright © 2023. All rights reserved.