public static final class BytesRules.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<BytesRules.Builder> 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| Modifier and Type | Method and Description |
|---|---|
BytesRules.Builder |
addAllIn(Iterable<? extends com.google.protobuf.ByteString> values)
`in` requires the field value to be equal to one of the specified
values.
|
BytesRules.Builder |
addAllNotIn(Iterable<? extends com.google.protobuf.ByteString> values)
`not_in` requires the field value to be not equal to any of the specified
values.
|
BytesRules.Builder |
addIn(com.google.protobuf.ByteString value)
`in` requires the field value to be equal to one of the specified
values.
|
BytesRules.Builder |
addNotIn(com.google.protobuf.ByteString value)
`not_in` requires the field value to be not equal to any of the specified
values.
|
BytesRules.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
BytesRules |
build() |
BytesRules |
buildPartial() |
BytesRules.Builder |
clear() |
BytesRules.Builder |
clearConst()
`const` requires the field value to exactly match the specified bytes
value.
|
BytesRules.Builder |
clearContains()
`contains` requires the field value to have the specified bytes anywhere in
the string.
|
BytesRules.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
BytesRules.Builder |
clearIn()
`in` requires the field value to be equal to one of the specified
values.
|
BytesRules.Builder |
clearIp()
`ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
|
BytesRules.Builder |
clearIpv4()
`ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
|
BytesRules.Builder |
clearIpv6()
`ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
|
BytesRules.Builder |
clearLen()
`len` requires the field value to have the specified length in bytes.
|
BytesRules.Builder |
clearMaxLen()
`max_len` requires the field value to have at most the specified maximum
length in bytes.
|
BytesRules.Builder |
clearMinLen()
`min_len` requires the field value to have at least the specified minimum
length in bytes.
|
BytesRules.Builder |
clearNotIn()
`not_in` requires the field value to be not equal to any of the specified
values.
|
BytesRules.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
BytesRules.Builder |
clearPattern()
`pattern` requires the field value to match the specified regular
expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
|
BytesRules.Builder |
clearPrefix()
`prefix` requires the field value to have the specified bytes at the
beginning of the string.
|
BytesRules.Builder |
clearSuffix()
`suffix` requires the field value to have the specified bytes at the end
of the string.
|
BytesRules.Builder |
clearWellKnown() |
BytesRules.Builder |
clone() |
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.
|
BytesRules |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
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.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
BytesRules.Builder |
mergeFrom(BytesRules other) |
BytesRules.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
BytesRules.Builder |
mergeFrom(com.google.protobuf.Message other) |
BytesRules.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
BytesRules.Builder |
setConst(com.google.protobuf.ByteString value)
`const` requires the field value to exactly match the specified bytes
value.
|
BytesRules.Builder |
setContains(com.google.protobuf.ByteString value)
`contains` requires the field value to have the specified bytes anywhere in
the string.
|
BytesRules.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
BytesRules.Builder |
setIn(int index,
com.google.protobuf.ByteString value)
`in` requires the field value to be equal to one of the specified
values.
|
BytesRules.Builder |
setIp(boolean value)
`ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
|
BytesRules.Builder |
setIpv4(boolean value)
`ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
|
BytesRules.Builder |
setIpv6(boolean value)
`ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
|
BytesRules.Builder |
setLen(long value)
`len` requires the field value to have the specified length in bytes.
|
BytesRules.Builder |
setMaxLen(long value)
`max_len` requires the field value to have at most the specified maximum
length in bytes.
|
BytesRules.Builder |
setMinLen(long value)
`min_len` requires the field value to have at least the specified minimum
length in bytes.
|
BytesRules.Builder |
setNotIn(int index,
com.google.protobuf.ByteString value)
`not_in` requires the field value to be not equal to any of the specified
values.
|
BytesRules.Builder |
setPattern(String value)
`pattern` requires the field value to match the specified regular
expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
|
BytesRules.Builder |
setPatternBytes(com.google.protobuf.ByteString value)
`pattern` requires the field value to match the specified regular
expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
|
BytesRules.Builder |
setPrefix(com.google.protobuf.ByteString value)
`prefix` requires the field value to have the specified bytes at the
beginning of the string.
|
BytesRules.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
BytesRules.Builder |
setSuffix(com.google.protobuf.ByteString value)
`suffix` requires the field value to have the specified bytes at the end
of the string.
|
BytesRules.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<BytesRules.Builder>public BytesRules.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<BytesRules.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<BytesRules.Builder>public BytesRules getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic BytesRules build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic BytesRules buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic BytesRules.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<BytesRules.Builder>public BytesRules.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<BytesRules.Builder>public BytesRules.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<BytesRules.Builder>public BytesRules.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<BytesRules.Builder>public BytesRules.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<BytesRules.Builder>public BytesRules.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<BytesRules.Builder>public BytesRules.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<BytesRules.Builder>public BytesRules.Builder mergeFrom(BytesRules other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<BytesRules.Builder>public BytesRules.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<BytesRules.Builder>IOExceptionpublic BytesRules.WellKnownCase getWellKnownCase()
getWellKnownCase in interface BytesRulesOrBuilderpublic BytesRules.Builder clearWellKnown()
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) = { ... }hasConst in interface BytesRulesOrBuilderpublic 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) = { ... }getConst in interface BytesRulesOrBuilderpublic BytesRules.Builder setConst(com.google.protobuf.ByteString value)
`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) = { ... }value - The const to set.public BytesRules.Builder clearConst()
`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) = { ... }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) = { ... }hasLen in interface BytesRulesOrBuilderpublic 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) = { ... }getLen in interface BytesRulesOrBuilderpublic BytesRules.Builder setLen(long value)
`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) = { ... }value - The len to set.public BytesRules.Builder clearLen()
`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) = { ... }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) = { ... }hasMinLen in interface BytesRulesOrBuilderpublic 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) = { ... }getMinLen in interface BytesRulesOrBuilderpublic BytesRules.Builder setMinLen(long value)
`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) = { ... }value - The minLen to set.public BytesRules.Builder clearMinLen()
`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) = { ... }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) = { ... }hasMaxLen in interface BytesRulesOrBuilderpublic 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) = { ... }getMaxLen in interface BytesRulesOrBuilderpublic BytesRules.Builder setMaxLen(long value)
`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) = { ... }value - The maxLen to set.public BytesRules.Builder clearMaxLen()
`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) = { ... }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) = { ... }hasPattern in interface BytesRulesOrBuilderpublic 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) = { ... }getPattern in interface BytesRulesOrBuilderpublic 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) = { ... }getPatternBytes in interface BytesRulesOrBuilderpublic BytesRules.Builder setPattern(String value)
`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) = { ... }value - The pattern to set.public BytesRules.Builder clearPattern()
`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) = { ... }public BytesRules.Builder setPatternBytes(com.google.protobuf.ByteString value)
`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) = { ... }value - The bytes for pattern to set.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) = { ... }hasPrefix in interface BytesRulesOrBuilderpublic 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) = { ... }getPrefix in interface BytesRulesOrBuilderpublic BytesRules.Builder setPrefix(com.google.protobuf.ByteString value)
`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) = { ... }value - The prefix to set.public BytesRules.Builder clearPrefix()
`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) = { ... }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) = { ... }hasSuffix in interface BytesRulesOrBuilderpublic 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) = { ... }getSuffix in interface BytesRulesOrBuilderpublic BytesRules.Builder setSuffix(com.google.protobuf.ByteString value)
`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) = { ... }value - The suffix to set.public BytesRules.Builder clearSuffix()
`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) = { ... }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) = { ... }hasContains in interface BytesRulesOrBuilderpublic 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) = { ... }getContains in interface BytesRulesOrBuilderpublic BytesRules.Builder setContains(com.google.protobuf.ByteString value)
`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) = { ... }value - The contains to set.public BytesRules.Builder clearContains()
`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) = { ... }public 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) = { ... }getInList in interface BytesRulesOrBuilderpublic 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) = { ... }getInCount in interface BytesRulesOrBuilderpublic 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) = { ... }getIn in interface BytesRulesOrBuilderindex - The index of the element to return.public BytesRules.Builder setIn(int index, com.google.protobuf.ByteString value)
`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 to set the value at.value - The in to set.public BytesRules.Builder addIn(com.google.protobuf.ByteString value)
`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) = { ... }value - The in to add.public BytesRules.Builder addAllIn(Iterable<? extends com.google.protobuf.ByteString> values)
`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) = { ... }values - The in to add.public BytesRules.Builder clearIn()
`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) = { ... }public 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) = { ... }getNotInList in interface BytesRulesOrBuilderpublic 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) = { ... }getNotInCount in interface BytesRulesOrBuilderpublic 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) = { ... }getNotIn in interface BytesRulesOrBuilderindex - The index of the element to return.public BytesRules.Builder setNotIn(int index, com.google.protobuf.ByteString value)
`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 to set the value at.value - The notIn to set.public BytesRules.Builder addNotIn(com.google.protobuf.ByteString value)
`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) = { ... }value - The notIn to add.public BytesRules.Builder addAllNotIn(Iterable<? extends com.google.protobuf.ByteString> values)
`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) = { ... }values - The notIn to add.public BytesRules.Builder clearNotIn()
`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) = { ... }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) = { ... }hasIp in interface BytesRulesOrBuilderpublic 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) = { ... }getIp in interface BytesRulesOrBuilderpublic BytesRules.Builder setIp(boolean value)
`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) = { ... }value - The ip to set.public BytesRules.Builder clearIp()
`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) = { ... }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) = { ... }hasIpv4 in interface BytesRulesOrBuilderpublic 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) = { ... }getIpv4 in interface BytesRulesOrBuilderpublic BytesRules.Builder setIpv4(boolean value)
`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) = { ... }value - The ipv4 to set.public BytesRules.Builder clearIpv4()
`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) = { ... }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) = { ... }hasIpv6 in interface BytesRulesOrBuilderpublic 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) = { ... }getIpv6 in interface BytesRulesOrBuilderpublic BytesRules.Builder setIpv6(boolean value)
`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) = { ... }value - The ipv6 to set.public BytesRules.Builder clearIpv6()
`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) = { ... }public final BytesRules.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<BytesRules.Builder>public final BytesRules.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<BytesRules.Builder>Copyright © 2024. All rights reserved.