build.buf.validate.BytesRulesOrBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of protovalidate Show documentation
Show all versions of protovalidate Show documentation
Protocol Buffer Validation
// Generated by the protocol buffer compiler. DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: buf/validate/validate.proto
// Protobuf Java Version: 4.28.1
package build.buf.validate;
public interface BytesRulesOrBuilder extends
// @@protoc_insertion_point(interface_extends:buf.validate.BytesRules)
com.google.protobuf.GeneratedMessage.
ExtendableMessageOrBuilder {
/**
*
* `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.predefined) = { ... }
* @return Whether the const field is set.
*/
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.predefined) = { ... }
* @return The const.
*/
com.google.protobuf.ByteString getConst();
/**
*
* `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.predefined) = { ... }
* @return Whether the len field is set.
*/
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.predefined) = { ... }
* @return The len.
*/
long getLen();
/**
*
* `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.predefined) = { ... }
* @return Whether the minLen field is set.
*/
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.predefined) = { ... }
* @return The minLen.
*/
long getMinLen();
/**
*
* `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.predefined) = { ... }
* @return Whether the maxLen field is set.
*/
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.predefined) = { ... }
* @return The maxLen.
*/
long getMaxLen();
/**
*
* `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.predefined) = { ... }
* @return Whether the pattern field is set.
*/
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.predefined) = { ... }
* @return The pattern.
*/
java.lang.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.predefined) = { ... }
* @return The bytes for pattern.
*/
com.google.protobuf.ByteString
getPatternBytes();
/**
*
* `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.predefined) = { ... }
* @return Whether the prefix field is set.
*/
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.predefined) = { ... }
* @return The prefix.
*/
com.google.protobuf.ByteString getPrefix();
/**
*
* `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.predefined) = { ... }
* @return Whether the suffix field is set.
*/
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.predefined) = { ... }
* @return The suffix.
*/
com.google.protobuf.ByteString getSuffix();
/**
*
* `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.predefined) = { ... }
* @return Whether the contains field is set.
*/
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.predefined) = { ... }
* @return The contains.
*/
com.google.protobuf.ByteString getContains();
/**
*
* `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.predefined) = { ... }
* @return A list containing the in.
*/
java.util.List 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.predefined) = { ... }
* @return The count of in.
*/
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.predefined) = { ... }
* @param index The index of the element to return.
* @return The in at the given index.
*/
com.google.protobuf.ByteString getIn(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.predefined) = { ... }
* @return A list containing the notIn.
*/
java.util.List 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.predefined) = { ... }
* @return The count of notIn.
*/
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.predefined) = { ... }
* @param index The index of the element to return.
* @return The notIn at the given index.
*/
com.google.protobuf.ByteString getNotIn(int index);
/**
*
* `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.predefined) = { ... }
* @return Whether the ip field is set.
*/
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.predefined) = { ... }
* @return The ip.
*/
boolean getIp();
/**
*
* `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.predefined) = { ... }
* @return Whether the ipv4 field is set.
*/
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.predefined) = { ... }
* @return The ipv4.
*/
boolean getIpv4();
/**
*
* `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.predefined) = { ... }
* @return Whether the ipv6 field is set.
*/
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.predefined) = { ... }
* @return The ipv6.
*/
boolean getIpv6();
/**
*
* `example` specifies values that the field may have. These values SHOULD
* conform to other constraints. `example` values will not impact validation
* but may be used as helpful guidance on how to populate the given field.
*
* ```proto
* message MyBytes {
* bytes value = 1 [
* (buf.validate.field).bytes.example = "\x01\x02",
* (buf.validate.field).bytes.example = "\x02\x03"
* ];
* }
* ```
*
*
* repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... }
* @return A list containing the example.
*/
java.util.List getExampleList();
/**
*
* `example` specifies values that the field may have. These values SHOULD
* conform to other constraints. `example` values will not impact validation
* but may be used as helpful guidance on how to populate the given field.
*
* ```proto
* message MyBytes {
* bytes value = 1 [
* (buf.validate.field).bytes.example = "\x01\x02",
* (buf.validate.field).bytes.example = "\x02\x03"
* ];
* }
* ```
*
*
* repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... }
* @return The count of example.
*/
int getExampleCount();
/**
*
* `example` specifies values that the field may have. These values SHOULD
* conform to other constraints. `example` values will not impact validation
* but may be used as helpful guidance on how to populate the given field.
*
* ```proto
* message MyBytes {
* bytes value = 1 [
* (buf.validate.field).bytes.example = "\x01\x02",
* (buf.validate.field).bytes.example = "\x02\x03"
* ];
* }
* ```
*
*
* repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... }
* @param index The index of the element to return.
* @return The example at the given index.
*/
com.google.protobuf.ByteString getExample(int index);
build.buf.validate.BytesRules.WellKnownCase getWellKnownCase();
}