build.buf.validate.StringRules 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;
/**
*
* StringRules describes the constraints applied to `string` values These
* rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type.
*
*
* Protobuf type {@code buf.validate.StringRules}
*/
public final class StringRules extends
com.google.protobuf.GeneratedMessage.ExtendableMessage<
StringRules> implements
// @@protoc_insertion_point(message_implements:buf.validate.StringRules)
StringRulesOrBuilder {
private static final long serialVersionUID = 0L;
static {
com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
/* major= */ 4,
/* minor= */ 28,
/* patch= */ 1,
/* suffix= */ "",
StringRules.class.getName());
}
// Use StringRules.newBuilder() to construct.
private StringRules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) {
super(builder);
}
private StringRules() {
const_ = "";
pattern_ = "";
prefix_ = "";
suffix_ = "";
contains_ = "";
notContains_ = "";
in_ =
com.google.protobuf.LazyStringArrayList.emptyList();
notIn_ =
com.google.protobuf.LazyStringArrayList.emptyList();
example_ =
com.google.protobuf.LazyStringArrayList.emptyList();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return build.buf.validate.ValidateProto.internal_static_buf_validate_StringRules_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return build.buf.validate.ValidateProto.internal_static_buf_validate_StringRules_fieldAccessorTable
.ensureFieldAccessorsInitialized(
build.buf.validate.StringRules.class, build.buf.validate.StringRules.Builder.class);
}
private int bitField0_;
private int wellKnownCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object wellKnown_;
public enum WellKnownCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
EMAIL(12),
HOSTNAME(13),
IP(14),
IPV4(15),
IPV6(16),
URI(17),
URI_REF(18),
ADDRESS(21),
UUID(22),
TUUID(33),
IP_WITH_PREFIXLEN(26),
IPV4_WITH_PREFIXLEN(27),
IPV6_WITH_PREFIXLEN(28),
IP_PREFIX(29),
IPV4_PREFIX(30),
IPV6_PREFIX(31),
HOST_AND_PORT(32),
WELL_KNOWN_REGEX(24),
WELLKNOWN_NOT_SET(0);
private final int value;
private WellKnownCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static WellKnownCase valueOf(int value) {
return forNumber(value);
}
public static WellKnownCase forNumber(int value) {
switch (value) {
case 12: return EMAIL;
case 13: return HOSTNAME;
case 14: return IP;
case 15: return IPV4;
case 16: return IPV6;
case 17: return URI;
case 18: return URI_REF;
case 21: return ADDRESS;
case 22: return UUID;
case 33: return TUUID;
case 26: return IP_WITH_PREFIXLEN;
case 27: return IPV4_WITH_PREFIXLEN;
case 28: return IPV6_WITH_PREFIXLEN;
case 29: return IP_PREFIX;
case 30: return IPV4_PREFIX;
case 31: return IPV6_PREFIX;
case 32: return HOST_AND_PORT;
case 24: return WELL_KNOWN_REGEX;
case 0: return WELLKNOWN_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public WellKnownCase
getWellKnownCase() {
return WellKnownCase.forNumber(
wellKnownCase_);
}
public static final int CONST_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object const_ = "";
/**
*
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MyString {
* // value must equal `hello`
* string value = 1 [(buf.validate.field).string.const = "hello"];
* }
* ```
*
*
* optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... }
* @return Whether the const field is set.
*/
@java.lang.Override
public boolean hasConst() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MyString {
* // value must equal `hello`
* string value = 1 [(buf.validate.field).string.const = "hello"];
* }
* ```
*
*
* optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... }
* @return The const.
*/
@java.lang.Override
public java.lang.String getConst() {
java.lang.Object ref = const_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
const_ = s;
}
return s;
}
}
/**
*
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MyString {
* // value must equal `hello`
* string value = 1 [(buf.validate.field).string.const = "hello"];
* }
* ```
*
*
* optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... }
* @return The bytes for const.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getConstBytes() {
java.lang.Object ref = const_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
const_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int LEN_FIELD_NUMBER = 19;
private long len_ = 0L;
/**
*
* `len` dictates that the field value must have the specified
* number of characters (Unicode code points), which may differ from the number
* of bytes in the string. If the field value does not meet the specified
* length, an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be 5 characters
* string value = 1 [(buf.validate.field).string.len = 5];
* }
* ```
*
*
* optional uint64 len = 19 [json_name = "len", (.buf.validate.predefined) = { ... }
* @return Whether the len field is set.
*/
@java.lang.Override
public boolean hasLen() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* `len` dictates that the field value must have the specified
* number of characters (Unicode code points), which may differ from the number
* of bytes in the string. If the field value does not meet the specified
* length, an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be 5 characters
* string value = 1 [(buf.validate.field).string.len = 5];
* }
* ```
*
*
* optional uint64 len = 19 [json_name = "len", (.buf.validate.predefined) = { ... }
* @return The len.
*/
@java.lang.Override
public long getLen() {
return len_;
}
public static final int MIN_LEN_FIELD_NUMBER = 2;
private long minLen_ = 0L;
/**
*
* `min_len` specifies that the field value must have at least the specified
* number of characters (Unicode code points), which may differ from the number
* of bytes in the string. If the field value contains fewer characters, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value length must be at least 3 characters
* string value = 1 [(buf.validate.field).string.min_len = 3];
* }
* ```
*
*
* optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... }
* @return Whether the minLen field is set.
*/
@java.lang.Override
public boolean hasMinLen() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
* `min_len` specifies that the field value must have at least the specified
* number of characters (Unicode code points), which may differ from the number
* of bytes in the string. If the field value contains fewer characters, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value length must be at least 3 characters
* string value = 1 [(buf.validate.field).string.min_len = 3];
* }
* ```
*
*
* optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... }
* @return The minLen.
*/
@java.lang.Override
public long getMinLen() {
return minLen_;
}
public static final int MAX_LEN_FIELD_NUMBER = 3;
private long maxLen_ = 0L;
/**
*
* `max_len` specifies that the field value must have no more than the specified
* number of characters (Unicode code points), which may differ from the
* number of bytes in the string. If the field value contains more characters,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be at most 10 characters
* string value = 1 [(buf.validate.field).string.max_len = 10];
* }
* ```
*
*
* optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... }
* @return Whether the maxLen field is set.
*/
@java.lang.Override
public boolean hasMaxLen() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
* `max_len` specifies that the field value must have no more than the specified
* number of characters (Unicode code points), which may differ from the
* number of bytes in the string. If the field value contains more characters,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be at most 10 characters
* string value = 1 [(buf.validate.field).string.max_len = 10];
* }
* ```
*
*
* optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... }
* @return The maxLen.
*/
@java.lang.Override
public long getMaxLen() {
return maxLen_;
}
public static final int LEN_BYTES_FIELD_NUMBER = 20;
private long lenBytes_ = 0L;
/**
*
* `len_bytes` dictates that the field value must have the specified number of
* bytes. If the field value does not match the specified length in bytes,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be 6 bytes
* string value = 1 [(buf.validate.field).string.len_bytes = 6];
* }
* ```
*
*
* optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.predefined) = { ... }
* @return Whether the lenBytes field is set.
*/
@java.lang.Override
public boolean hasLenBytes() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
*
* `len_bytes` dictates that the field value must have the specified number of
* bytes. If the field value does not match the specified length in bytes,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be 6 bytes
* string value = 1 [(buf.validate.field).string.len_bytes = 6];
* }
* ```
*
*
* optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.predefined) = { ... }
* @return The lenBytes.
*/
@java.lang.Override
public long getLenBytes() {
return lenBytes_;
}
public static final int MIN_BYTES_FIELD_NUMBER = 4;
private long minBytes_ = 0L;
/**
*
* `min_bytes` specifies that the field value must have at least the specified
* number of bytes. If the field value contains fewer bytes, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value length must be at least 4 bytes
* string value = 1 [(buf.validate.field).string.min_bytes = 4];
* }
*
* ```
*
*
* optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.predefined) = { ... }
* @return Whether the minBytes field is set.
*/
@java.lang.Override
public boolean hasMinBytes() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
*
* `min_bytes` specifies that the field value must have at least the specified
* number of bytes. If the field value contains fewer bytes, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value length must be at least 4 bytes
* string value = 1 [(buf.validate.field).string.min_bytes = 4];
* }
*
* ```
*
*
* optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.predefined) = { ... }
* @return The minBytes.
*/
@java.lang.Override
public long getMinBytes() {
return minBytes_;
}
public static final int MAX_BYTES_FIELD_NUMBER = 5;
private long maxBytes_ = 0L;
/**
*
* `max_bytes` specifies that the field value must have no more than the
* specified number of bytes. If the field value contains more bytes, an
* error message will be generated.
*
* ```proto
* message MyString {
* // value length must be at most 8 bytes
* string value = 1 [(buf.validate.field).string.max_bytes = 8];
* }
* ```
*
*
* optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.predefined) = { ... }
* @return Whether the maxBytes field is set.
*/
@java.lang.Override
public boolean hasMaxBytes() {
return ((bitField0_ & 0x00000040) != 0);
}
/**
*
* `max_bytes` specifies that the field value must have no more than the
* specified number of bytes. If the field value contains more bytes, an
* error message will be generated.
*
* ```proto
* message MyString {
* // value length must be at most 8 bytes
* string value = 1 [(buf.validate.field).string.max_bytes = 8];
* }
* ```
*
*
* optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.predefined) = { ... }
* @return The maxBytes.
*/
@java.lang.Override
public long getMaxBytes() {
return maxBytes_;
}
public static final int PATTERN_FIELD_NUMBER = 6;
@SuppressWarnings("serial")
private volatile java.lang.Object pattern_ = "";
/**
*
* `pattern` specifies that the field value must match the specified
* regular expression (RE2 syntax), with the expression provided without any
* delimiters. If the field value doesn't match the regular expression, an
* error message will be generated.
*
* ```proto
* message MyString {
* // value does not match regex pattern `^[a-zA-Z]//$`
* string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"];
* }
* ```
*
*
* optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... }
* @return Whether the pattern field is set.
*/
@java.lang.Override
public boolean hasPattern() {
return ((bitField0_ & 0x00000080) != 0);
}
/**
*
* `pattern` specifies that the field value must match the specified
* regular expression (RE2 syntax), with the expression provided without any
* delimiters. If the field value doesn't match the regular expression, an
* error message will be generated.
*
* ```proto
* message MyString {
* // value does not match regex pattern `^[a-zA-Z]//$`
* string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"];
* }
* ```
*
*
* optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... }
* @return The pattern.
*/
@java.lang.Override
public java.lang.String getPattern() {
java.lang.Object ref = pattern_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
pattern_ = s;
}
return s;
}
}
/**
*
* `pattern` specifies that the field value must match the specified
* regular expression (RE2 syntax), with the expression provided without any
* delimiters. If the field value doesn't match the regular expression, an
* error message will be generated.
*
* ```proto
* message MyString {
* // value does not match regex pattern `^[a-zA-Z]//$`
* string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"];
* }
* ```
*
*
* optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... }
* @return The bytes for pattern.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getPatternBytes() {
java.lang.Object ref = pattern_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
pattern_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PREFIX_FIELD_NUMBER = 7;
@SuppressWarnings("serial")
private volatile java.lang.Object prefix_ = "";
/**
*
* `prefix` specifies that the field value must have the
* specified substring at the beginning of the string. If the field value
* doesn't start with the specified prefix, an error message will be
* generated.
*
* ```proto
* message MyString {
* // value does not have prefix `pre`
* string value = 1 [(buf.validate.field).string.prefix = "pre"];
* }
* ```
*
*
* optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... }
* @return Whether the prefix field is set.
*/
@java.lang.Override
public boolean hasPrefix() {
return ((bitField0_ & 0x00000100) != 0);
}
/**
*
* `prefix` specifies that the field value must have the
* specified substring at the beginning of the string. If the field value
* doesn't start with the specified prefix, an error message will be
* generated.
*
* ```proto
* message MyString {
* // value does not have prefix `pre`
* string value = 1 [(buf.validate.field).string.prefix = "pre"];
* }
* ```
*
*
* optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... }
* @return The prefix.
*/
@java.lang.Override
public java.lang.String getPrefix() {
java.lang.Object ref = prefix_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
prefix_ = s;
}
return s;
}
}
/**
*
* `prefix` specifies that the field value must have the
* specified substring at the beginning of the string. If the field value
* doesn't start with the specified prefix, an error message will be
* generated.
*
* ```proto
* message MyString {
* // value does not have prefix `pre`
* string value = 1 [(buf.validate.field).string.prefix = "pre"];
* }
* ```
*
*
* optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... }
* @return The bytes for prefix.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getPrefixBytes() {
java.lang.Object ref = prefix_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
prefix_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SUFFIX_FIELD_NUMBER = 8;
@SuppressWarnings("serial")
private volatile java.lang.Object suffix_ = "";
/**
*
* `suffix` specifies that the field value must have the
* specified substring at the end of the string. If the field value doesn't
* end with the specified suffix, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not have suffix `post`
* string value = 1 [(buf.validate.field).string.suffix = "post"];
* }
* ```
*
*
* optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... }
* @return Whether the suffix field is set.
*/
@java.lang.Override
public boolean hasSuffix() {
return ((bitField0_ & 0x00000200) != 0);
}
/**
*
* `suffix` specifies that the field value must have the
* specified substring at the end of the string. If the field value doesn't
* end with the specified suffix, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not have suffix `post`
* string value = 1 [(buf.validate.field).string.suffix = "post"];
* }
* ```
*
*
* optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... }
* @return The suffix.
*/
@java.lang.Override
public java.lang.String getSuffix() {
java.lang.Object ref = suffix_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
suffix_ = s;
}
return s;
}
}
/**
*
* `suffix` specifies that the field value must have the
* specified substring at the end of the string. If the field value doesn't
* end with the specified suffix, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not have suffix `post`
* string value = 1 [(buf.validate.field).string.suffix = "post"];
* }
* ```
*
*
* optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... }
* @return The bytes for suffix.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getSuffixBytes() {
java.lang.Object ref = suffix_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
suffix_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int CONTAINS_FIELD_NUMBER = 9;
@SuppressWarnings("serial")
private volatile java.lang.Object contains_ = "";
/**
*
* `contains` specifies that the field value must have the
* specified substring anywhere in the string. If the field value doesn't
* contain the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not contain substring `inside`.
* string value = 1 [(buf.validate.field).string.contains = "inside"];
* }
* ```
*
*
* optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... }
* @return Whether the contains field is set.
*/
@java.lang.Override
public boolean hasContains() {
return ((bitField0_ & 0x00000400) != 0);
}
/**
*
* `contains` specifies that the field value must have the
* specified substring anywhere in the string. If the field value doesn't
* contain the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not contain substring `inside`.
* string value = 1 [(buf.validate.field).string.contains = "inside"];
* }
* ```
*
*
* optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... }
* @return The contains.
*/
@java.lang.Override
public java.lang.String getContains() {
java.lang.Object ref = contains_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
contains_ = s;
}
return s;
}
}
/**
*
* `contains` specifies that the field value must have the
* specified substring anywhere in the string. If the field value doesn't
* contain the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not contain substring `inside`.
* string value = 1 [(buf.validate.field).string.contains = "inside"];
* }
* ```
*
*
* optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... }
* @return The bytes for contains.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getContainsBytes() {
java.lang.Object ref = contains_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
contains_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int NOT_CONTAINS_FIELD_NUMBER = 23;
@SuppressWarnings("serial")
private volatile java.lang.Object notContains_ = "";
/**
*
* `not_contains` specifies that the field value must not have the
* specified substring anywhere in the string. If the field value contains
* the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value contains substring `inside`.
* string value = 1 [(buf.validate.field).string.not_contains = "inside"];
* }
* ```
*
*
* optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... }
* @return Whether the notContains field is set.
*/
@java.lang.Override
public boolean hasNotContains() {
return ((bitField0_ & 0x00000800) != 0);
}
/**
*
* `not_contains` specifies that the field value must not have the
* specified substring anywhere in the string. If the field value contains
* the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value contains substring `inside`.
* string value = 1 [(buf.validate.field).string.not_contains = "inside"];
* }
* ```
*
*
* optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... }
* @return The notContains.
*/
@java.lang.Override
public java.lang.String getNotContains() {
java.lang.Object ref = notContains_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
notContains_ = s;
}
return s;
}
}
/**
*
* `not_contains` specifies that the field value must not have the
* specified substring anywhere in the string. If the field value contains
* the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value contains substring `inside`.
* string value = 1 [(buf.validate.field).string.not_contains = "inside"];
* }
* ```
*
*
* optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... }
* @return The bytes for notContains.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getNotContainsBytes() {
java.lang.Object ref = notContains_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
notContains_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int IN_FIELD_NUMBER = 10;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList in_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
* `in` specifies that the field value must be equal to one of the specified
* values. If the field value isn't one of the specified values, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be in list ["apple", "banana"]
* repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
* }
* ```
*
*
* repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... }
* @return A list containing the in.
*/
public com.google.protobuf.ProtocolStringList
getInList() {
return in_;
}
/**
*
* `in` specifies that the field value must be equal to one of the specified
* values. If the field value isn't one of the specified values, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be in list ["apple", "banana"]
* repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
* }
* ```
*
*
* repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... }
* @return The count of in.
*/
public int getInCount() {
return in_.size();
}
/**
*
* `in` specifies that the field value must be equal to one of the specified
* values. If the field value isn't one of the specified values, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be in list ["apple", "banana"]
* repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
* }
* ```
*
*
* repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... }
* @param index The index of the element to return.
* @return The in at the given index.
*/
public java.lang.String getIn(int index) {
return in_.get(index);
}
/**
*
* `in` specifies that the field value must be equal to one of the specified
* values. If the field value isn't one of the specified values, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be in list ["apple", "banana"]
* repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
* }
* ```
*
*
* repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... }
* @param index The index of the value to return.
* @return The bytes of the in at the given index.
*/
public com.google.protobuf.ByteString
getInBytes(int index) {
return in_.getByteString(index);
}
public static final int NOT_IN_FIELD_NUMBER = 11;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList notIn_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
* `not_in` specifies that the field value cannot be equal to any
* of the specified values. If the field value is one of the specified values,
* an error message will be generated.
* ```proto
* message MyString {
* // value must not be in list ["orange", "grape"]
* repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
* }
* ```
*
*
* repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... }
* @return A list containing the notIn.
*/
public com.google.protobuf.ProtocolStringList
getNotInList() {
return notIn_;
}
/**
*
* `not_in` specifies that the field value cannot be equal to any
* of the specified values. If the field value is one of the specified values,
* an error message will be generated.
* ```proto
* message MyString {
* // value must not be in list ["orange", "grape"]
* repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
* }
* ```
*
*
* repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... }
* @return The count of notIn.
*/
public int getNotInCount() {
return notIn_.size();
}
/**
*
* `not_in` specifies that the field value cannot be equal to any
* of the specified values. If the field value is one of the specified values,
* an error message will be generated.
* ```proto
* message MyString {
* // value must not be in list ["orange", "grape"]
* repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
* }
* ```
*
*
* repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... }
* @param index The index of the element to return.
* @return The notIn at the given index.
*/
public java.lang.String getNotIn(int index) {
return notIn_.get(index);
}
/**
*
* `not_in` specifies that the field value cannot be equal to any
* of the specified values. If the field value is one of the specified values,
* an error message will be generated.
* ```proto
* message MyString {
* // value must not be in list ["orange", "grape"]
* repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
* }
* ```
*
*
* repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... }
* @param index The index of the value to return.
* @return The bytes of the notIn at the given index.
*/
public com.google.protobuf.ByteString
getNotInBytes(int index) {
return notIn_.getByteString(index);
}
public static final int EMAIL_FIELD_NUMBER = 12;
/**
*
* `email` specifies that the field value must be a valid email address
* (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1).
* If the field value isn't a valid email address, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid email address
* string value = 1 [(buf.validate.field).string.email = true];
* }
* ```
*
*
* bool email = 12 [json_name = "email", (.buf.validate.predefined) = { ... }
* @return Whether the email field is set.
*/
@java.lang.Override
public boolean hasEmail() {
return wellKnownCase_ == 12;
}
/**
*
* `email` specifies that the field value must be a valid email address
* (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1).
* If the field value isn't a valid email address, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid email address
* string value = 1 [(buf.validate.field).string.email = true];
* }
* ```
*
*
* bool email = 12 [json_name = "email", (.buf.validate.predefined) = { ... }
* @return The email.
*/
@java.lang.Override
public boolean getEmail() {
if (wellKnownCase_ == 12) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int HOSTNAME_FIELD_NUMBER = 13;
/**
*
* `hostname` specifies that the field value must be a valid
* hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support
* internationalized domain names (IDNs). If the field value isn't a
* valid hostname, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid hostname
* string value = 1 [(buf.validate.field).string.hostname = true];
* }
* ```
*
*
* bool hostname = 13 [json_name = "hostname", (.buf.validate.predefined) = { ... }
* @return Whether the hostname field is set.
*/
@java.lang.Override
public boolean hasHostname() {
return wellKnownCase_ == 13;
}
/**
*
* `hostname` specifies that the field value must be a valid
* hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support
* internationalized domain names (IDNs). If the field value isn't a
* valid hostname, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid hostname
* string value = 1 [(buf.validate.field).string.hostname = true];
* }
* ```
*
*
* bool hostname = 13 [json_name = "hostname", (.buf.validate.predefined) = { ... }
* @return The hostname.
*/
@java.lang.Override
public boolean getHostname() {
if (wellKnownCase_ == 13) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int IP_FIELD_NUMBER = 14;
/**
*
* `ip` specifies that the field value must be a valid IP
* (v4 or v6) address, without surrounding square brackets for IPv6 addresses.
* If the field value isn't a valid IP address, an error message will be
* generated.
*
* ```proto
* message MyString {
* // value must be a valid IP address
* string value = 1 [(buf.validate.field).string.ip = true];
* }
* ```
*
*
* bool ip = 14 [json_name = "ip", (.buf.validate.predefined) = { ... }
* @return Whether the ip field is set.
*/
@java.lang.Override
public boolean hasIp() {
return wellKnownCase_ == 14;
}
/**
*
* `ip` specifies that the field value must be a valid IP
* (v4 or v6) address, without surrounding square brackets for IPv6 addresses.
* If the field value isn't a valid IP address, an error message will be
* generated.
*
* ```proto
* message MyString {
* // value must be a valid IP address
* string value = 1 [(buf.validate.field).string.ip = true];
* }
* ```
*
*
* bool ip = 14 [json_name = "ip", (.buf.validate.predefined) = { ... }
* @return The ip.
*/
@java.lang.Override
public boolean getIp() {
if (wellKnownCase_ == 14) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int IPV4_FIELD_NUMBER = 15;
/**
*
* `ipv4` specifies that the field value must be a valid IPv4
* address. If the field value isn't a valid IPv4 address, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv4 address
* string value = 1 [(buf.validate.field).string.ipv4 = true];
* }
* ```
*
*
* bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.predefined) = { ... }
* @return Whether the ipv4 field is set.
*/
@java.lang.Override
public boolean hasIpv4() {
return wellKnownCase_ == 15;
}
/**
*
* `ipv4` specifies that the field value must be a valid IPv4
* address. If the field value isn't a valid IPv4 address, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv4 address
* string value = 1 [(buf.validate.field).string.ipv4 = true];
* }
* ```
*
*
* bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.predefined) = { ... }
* @return The ipv4.
*/
@java.lang.Override
public boolean getIpv4() {
if (wellKnownCase_ == 15) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int IPV6_FIELD_NUMBER = 16;
/**
*
* `ipv6` specifies that the field value must be a valid
* IPv6 address, without surrounding square brackets. If the field value is
* not a valid IPv6 address, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv6 address
* string value = 1 [(buf.validate.field).string.ipv6 = true];
* }
* ```
*
*
* bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.predefined) = { ... }
* @return Whether the ipv6 field is set.
*/
@java.lang.Override
public boolean hasIpv6() {
return wellKnownCase_ == 16;
}
/**
*
* `ipv6` specifies that the field value must be a valid
* IPv6 address, without surrounding square brackets. If the field value is
* not a valid IPv6 address, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv6 address
* string value = 1 [(buf.validate.field).string.ipv6 = true];
* }
* ```
*
*
* bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.predefined) = { ... }
* @return The ipv6.
*/
@java.lang.Override
public boolean getIpv6() {
if (wellKnownCase_ == 16) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int URI_FIELD_NUMBER = 17;
/**
*
* `uri` specifies that the field value must be a valid,
* absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid,
* absolute URI, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid URI
* string value = 1 [(buf.validate.field).string.uri = true];
* }
* ```
*
*
* bool uri = 17 [json_name = "uri", (.buf.validate.predefined) = { ... }
* @return Whether the uri field is set.
*/
@java.lang.Override
public boolean hasUri() {
return wellKnownCase_ == 17;
}
/**
*
* `uri` specifies that the field value must be a valid,
* absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid,
* absolute URI, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid URI
* string value = 1 [(buf.validate.field).string.uri = true];
* }
* ```
*
*
* bool uri = 17 [json_name = "uri", (.buf.validate.predefined) = { ... }
* @return The uri.
*/
@java.lang.Override
public boolean getUri() {
if (wellKnownCase_ == 17) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int URI_REF_FIELD_NUMBER = 18;
/**
*
* `uri_ref` specifies that the field value must be a valid URI
* as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the
* field value isn't a valid URI, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid URI
* string value = 1 [(buf.validate.field).string.uri_ref = true];
* }
* ```
*
*
* bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.predefined) = { ... }
* @return Whether the uriRef field is set.
*/
@java.lang.Override
public boolean hasUriRef() {
return wellKnownCase_ == 18;
}
/**
*
* `uri_ref` specifies that the field value must be a valid URI
* as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the
* field value isn't a valid URI, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid URI
* string value = 1 [(buf.validate.field).string.uri_ref = true];
* }
* ```
*
*
* bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.predefined) = { ... }
* @return The uriRef.
*/
@java.lang.Override
public boolean getUriRef() {
if (wellKnownCase_ == 18) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int ADDRESS_FIELD_NUMBER = 21;
/**
*
* `address` specifies that the field value must be either a valid hostname
* as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5)
* (which doesn't support internationalized domain names or IDNs) or a valid
* IP (v4 or v6). If the field value isn't a valid hostname or IP, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid hostname, or ip address
* string value = 1 [(buf.validate.field).string.address = true];
* }
* ```
*
*
* bool address = 21 [json_name = "address", (.buf.validate.predefined) = { ... }
* @return Whether the address field is set.
*/
@java.lang.Override
public boolean hasAddress() {
return wellKnownCase_ == 21;
}
/**
*
* `address` specifies that the field value must be either a valid hostname
* as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5)
* (which doesn't support internationalized domain names or IDNs) or a valid
* IP (v4 or v6). If the field value isn't a valid hostname or IP, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid hostname, or ip address
* string value = 1 [(buf.validate.field).string.address = true];
* }
* ```
*
*
* bool address = 21 [json_name = "address", (.buf.validate.predefined) = { ... }
* @return The address.
*/
@java.lang.Override
public boolean getAddress() {
if (wellKnownCase_ == 21) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int UUID_FIELD_NUMBER = 22;
/**
*
* `uuid` specifies that the field value must be a valid UUID as defined by
* [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the
* field value isn't a valid UUID, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid UUID
* string value = 1 [(buf.validate.field).string.uuid = true];
* }
* ```
*
*
* bool uuid = 22 [json_name = "uuid", (.buf.validate.predefined) = { ... }
* @return Whether the uuid field is set.
*/
@java.lang.Override
public boolean hasUuid() {
return wellKnownCase_ == 22;
}
/**
*
* `uuid` specifies that the field value must be a valid UUID as defined by
* [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the
* field value isn't a valid UUID, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid UUID
* string value = 1 [(buf.validate.field).string.uuid = true];
* }
* ```
*
*
* bool uuid = 22 [json_name = "uuid", (.buf.validate.predefined) = { ... }
* @return The uuid.
*/
@java.lang.Override
public boolean getUuid() {
if (wellKnownCase_ == 22) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int TUUID_FIELD_NUMBER = 33;
/**
*
* `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as
* defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2) with all dashes
* omitted. If the field value isn't a valid UUID without dashes, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value must be a valid trimmed UUID
* string value = 1 [(buf.validate.field).string.tuuid = true];
* }
* ```
*
*
* bool tuuid = 33 [json_name = "tuuid", (.buf.validate.predefined) = { ... }
* @return Whether the tuuid field is set.
*/
@java.lang.Override
public boolean hasTuuid() {
return wellKnownCase_ == 33;
}
/**
*
* `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as
* defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2) with all dashes
* omitted. If the field value isn't a valid UUID without dashes, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value must be a valid trimmed UUID
* string value = 1 [(buf.validate.field).string.tuuid = true];
* }
* ```
*
*
* bool tuuid = 33 [json_name = "tuuid", (.buf.validate.predefined) = { ... }
* @return The tuuid.
*/
@java.lang.Override
public boolean getTuuid() {
if (wellKnownCase_ == 33) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int IP_WITH_PREFIXLEN_FIELD_NUMBER = 26;
/**
*
* `ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6)
* address with prefix length. If the field value isn't a valid IP with prefix
* length, an error message will be generated.
*
*
* ```proto
* message MyString {
* // value must be a valid IP with prefix length
* string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];
* }
* ```
*
*
* bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.predefined) = { ... }
* @return Whether the ipWithPrefixlen field is set.
*/
@java.lang.Override
public boolean hasIpWithPrefixlen() {
return wellKnownCase_ == 26;
}
/**
*
* `ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6)
* address with prefix length. If the field value isn't a valid IP with prefix
* length, an error message will be generated.
*
*
* ```proto
* message MyString {
* // value must be a valid IP with prefix length
* string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];
* }
* ```
*
*
* bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.predefined) = { ... }
* @return The ipWithPrefixlen.
*/
@java.lang.Override
public boolean getIpWithPrefixlen() {
if (wellKnownCase_ == 26) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int IPV4_WITH_PREFIXLEN_FIELD_NUMBER = 27;
/**
*
* `ipv4_with_prefixlen` specifies that the field value must be a valid
* IPv4 address with prefix.
* If the field value isn't a valid IPv4 address with prefix length,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv4 address with prefix length
* string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
* }
* ```
*
*
* bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.predefined) = { ... }
* @return Whether the ipv4WithPrefixlen field is set.
*/
@java.lang.Override
public boolean hasIpv4WithPrefixlen() {
return wellKnownCase_ == 27;
}
/**
*
* `ipv4_with_prefixlen` specifies that the field value must be a valid
* IPv4 address with prefix.
* If the field value isn't a valid IPv4 address with prefix length,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv4 address with prefix length
* string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
* }
* ```
*
*
* bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.predefined) = { ... }
* @return The ipv4WithPrefixlen.
*/
@java.lang.Override
public boolean getIpv4WithPrefixlen() {
if (wellKnownCase_ == 27) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int IPV6_WITH_PREFIXLEN_FIELD_NUMBER = 28;
/**
*
* `ipv6_with_prefixlen` specifies that the field value must be a valid
* IPv6 address with prefix length.
* If the field value is not a valid IPv6 address with prefix length,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv6 address prefix length
* string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];
* }
* ```
*
*
* bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.predefined) = { ... }
* @return Whether the ipv6WithPrefixlen field is set.
*/
@java.lang.Override
public boolean hasIpv6WithPrefixlen() {
return wellKnownCase_ == 28;
}
/**
*
* `ipv6_with_prefixlen` specifies that the field value must be a valid
* IPv6 address with prefix length.
* If the field value is not a valid IPv6 address with prefix length,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv6 address prefix length
* string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];
* }
* ```
*
*
* bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.predefined) = { ... }
* @return The ipv6WithPrefixlen.
*/
@java.lang.Override
public boolean getIpv6WithPrefixlen() {
if (wellKnownCase_ == 28) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int IP_PREFIX_FIELD_NUMBER = 29;
/**
*
* `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix.
* If the field value isn't a valid IP prefix, an error message will be
* generated. The prefix must have all zeros for the masked bits of the prefix (e.g.,
* `127.0.0.0/16`, not `127.0.0.1/16`).
*
* ```proto
* message MyString {
* // value must be a valid IP prefix
* string value = 1 [(buf.validate.field).string.ip_prefix = true];
* }
* ```
*
*
* bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.predefined) = { ... }
* @return Whether the ipPrefix field is set.
*/
@java.lang.Override
public boolean hasIpPrefix() {
return wellKnownCase_ == 29;
}
/**
*
* `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix.
* If the field value isn't a valid IP prefix, an error message will be
* generated. The prefix must have all zeros for the masked bits of the prefix (e.g.,
* `127.0.0.0/16`, not `127.0.0.1/16`).
*
* ```proto
* message MyString {
* // value must be a valid IP prefix
* string value = 1 [(buf.validate.field).string.ip_prefix = true];
* }
* ```
*
*
* bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.predefined) = { ... }
* @return The ipPrefix.
*/
@java.lang.Override
public boolean getIpPrefix() {
if (wellKnownCase_ == 29) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int IPV4_PREFIX_FIELD_NUMBER = 30;
/**
*
* `ipv4_prefix` specifies that the field value must be a valid IPv4
* prefix. If the field value isn't a valid IPv4 prefix, an error message
* will be generated. The prefix must have all zeros for the masked bits of
* the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`).
*
* ```proto
* message MyString {
* // value must be a valid IPv4 prefix
* string value = 1 [(buf.validate.field).string.ipv4_prefix = true];
* }
* ```
*
*
* bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.predefined) = { ... }
* @return Whether the ipv4Prefix field is set.
*/
@java.lang.Override
public boolean hasIpv4Prefix() {
return wellKnownCase_ == 30;
}
/**
*
* `ipv4_prefix` specifies that the field value must be a valid IPv4
* prefix. If the field value isn't a valid IPv4 prefix, an error message
* will be generated. The prefix must have all zeros for the masked bits of
* the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`).
*
* ```proto
* message MyString {
* // value must be a valid IPv4 prefix
* string value = 1 [(buf.validate.field).string.ipv4_prefix = true];
* }
* ```
*
*
* bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.predefined) = { ... }
* @return The ipv4Prefix.
*/
@java.lang.Override
public boolean getIpv4Prefix() {
if (wellKnownCase_ == 30) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int IPV6_PREFIX_FIELD_NUMBER = 31;
/**
*
* `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix.
* If the field value is not a valid IPv6 prefix, an error message will be
* generated. The prefix must have all zeros for the masked bits of the prefix
* (e.g., `2001:db8::/48`, not `2001:db8::1/48`).
*
* ```proto
* message MyString {
* // value must be a valid IPv6 prefix
* string value = 1 [(buf.validate.field).string.ipv6_prefix = true];
* }
* ```
*
*
* bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.predefined) = { ... }
* @return Whether the ipv6Prefix field is set.
*/
@java.lang.Override
public boolean hasIpv6Prefix() {
return wellKnownCase_ == 31;
}
/**
*
* `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix.
* If the field value is not a valid IPv6 prefix, an error message will be
* generated. The prefix must have all zeros for the masked bits of the prefix
* (e.g., `2001:db8::/48`, not `2001:db8::1/48`).
*
* ```proto
* message MyString {
* // value must be a valid IPv6 prefix
* string value = 1 [(buf.validate.field).string.ipv6_prefix = true];
* }
* ```
*
*
* bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.predefined) = { ... }
* @return The ipv6Prefix.
*/
@java.lang.Override
public boolean getIpv6Prefix() {
if (wellKnownCase_ == 31) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int HOST_AND_PORT_FIELD_NUMBER = 32;
/**
*
* `host_and_port` specifies the field value must be a valid host and port
* pair. The host must be a valid hostname or IP address while the port
* must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
* with square brackets (e.g., `[::1]:1234`).
*
*
* bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.predefined) = { ... }
* @return Whether the hostAndPort field is set.
*/
@java.lang.Override
public boolean hasHostAndPort() {
return wellKnownCase_ == 32;
}
/**
*
* `host_and_port` specifies the field value must be a valid host and port
* pair. The host must be a valid hostname or IP address while the port
* must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
* with square brackets (e.g., `[::1]:1234`).
*
*
* bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.predefined) = { ... }
* @return The hostAndPort.
*/
@java.lang.Override
public boolean getHostAndPort() {
if (wellKnownCase_ == 32) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
public static final int WELL_KNOWN_REGEX_FIELD_NUMBER = 24;
/**
*
* `well_known_regex` specifies a common well-known pattern
* defined as a regex. If the field value doesn't match the well-known
* regex, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid HTTP header value
* string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
* }
* ```
*
* #### KnownRegex
*
* `well_known_regex` contains some well-known patterns.
*
* | Name | Number | Description |
* |-------------------------------|--------|-------------------------------------------|
* | KNOWN_REGEX_UNSPECIFIED | 0 | |
* | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) |
* | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |
*
*
* .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.predefined) = { ... }
* @return Whether the wellKnownRegex field is set.
*/
public boolean hasWellKnownRegex() {
return wellKnownCase_ == 24;
}
/**
*
* `well_known_regex` specifies a common well-known pattern
* defined as a regex. If the field value doesn't match the well-known
* regex, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid HTTP header value
* string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
* }
* ```
*
* #### KnownRegex
*
* `well_known_regex` contains some well-known patterns.
*
* | Name | Number | Description |
* |-------------------------------|--------|-------------------------------------------|
* | KNOWN_REGEX_UNSPECIFIED | 0 | |
* | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) |
* | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |
*
*
* .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.predefined) = { ... }
* @return The wellKnownRegex.
*/
public build.buf.validate.KnownRegex getWellKnownRegex() {
if (wellKnownCase_ == 24) {
build.buf.validate.KnownRegex result = build.buf.validate.KnownRegex.forNumber(
(java.lang.Integer) wellKnown_);
return result == null ? build.buf.validate.KnownRegex.KNOWN_REGEX_UNSPECIFIED : result;
}
return build.buf.validate.KnownRegex.KNOWN_REGEX_UNSPECIFIED;
}
public static final int STRICT_FIELD_NUMBER = 25;
private boolean strict_ = false;
/**
*
* This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to
* enable strict header validation. By default, this is true, and HTTP header
* validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser
* validations that only disallow `\r\n\0` characters, which can be used to
* bypass header matching rules.
*
* ```proto
* message MyString {
* // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.
* string value = 1 [(buf.validate.field).string.strict = false];
* }
* ```
*
*
* optional bool strict = 25 [json_name = "strict"];
* @return Whether the strict field is set.
*/
@java.lang.Override
public boolean hasStrict() {
return ((bitField0_ & 0x00001000) != 0);
}
/**
*
* This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to
* enable strict header validation. By default, this is true, and HTTP header
* validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser
* validations that only disallow `\r\n\0` characters, which can be used to
* bypass header matching rules.
*
* ```proto
* message MyString {
* // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.
* string value = 1 [(buf.validate.field).string.strict = false];
* }
* ```
*
*
* optional bool strict = 25 [json_name = "strict"];
* @return The strict.
*/
@java.lang.Override
public boolean getStrict() {
return strict_;
}
public static final int EXAMPLE_FIELD_NUMBER = 34;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList example_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
* `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 MyString {
* string value = 1 [
* (buf.validate.field).string.example = 1,
* (buf.validate.field).string.example = 2
* ];
* }
* ```
*
*
* repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... }
* @return A list containing the example.
*/
public com.google.protobuf.ProtocolStringList
getExampleList() {
return example_;
}
/**
*
* `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 MyString {
* string value = 1 [
* (buf.validate.field).string.example = 1,
* (buf.validate.field).string.example = 2
* ];
* }
* ```
*
*
* repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... }
* @return The count of example.
*/
public int getExampleCount() {
return example_.size();
}
/**
*
* `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 MyString {
* string value = 1 [
* (buf.validate.field).string.example = 1,
* (buf.validate.field).string.example = 2
* ];
* }
* ```
*
*
* repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... }
* @param index The index of the element to return.
* @return The example at the given index.
*/
public java.lang.String getExample(int index) {
return example_.get(index);
}
/**
*
* `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 MyString {
* string value = 1 [
* (buf.validate.field).string.example = 1,
* (buf.validate.field).string.example = 2
* ];
* }
* ```
*
*
* repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... }
* @param index The index of the value to return.
* @return The bytes of the example at the given index.
*/
public com.google.protobuf.ByteString
getExampleBytes(int index) {
return example_.getByteString(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!extensionsAreInitialized()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
com.google.protobuf.GeneratedMessage
.ExtendableMessage.ExtensionSerializer
extensionWriter = newExtensionSerializer();
if (((bitField0_ & 0x00000001) != 0)) {
com.google.protobuf.GeneratedMessage.writeString(output, 1, const_);
}
if (((bitField0_ & 0x00000004) != 0)) {
output.writeUInt64(2, minLen_);
}
if (((bitField0_ & 0x00000008) != 0)) {
output.writeUInt64(3, maxLen_);
}
if (((bitField0_ & 0x00000020) != 0)) {
output.writeUInt64(4, minBytes_);
}
if (((bitField0_ & 0x00000040) != 0)) {
output.writeUInt64(5, maxBytes_);
}
if (((bitField0_ & 0x00000080) != 0)) {
com.google.protobuf.GeneratedMessage.writeString(output, 6, pattern_);
}
if (((bitField0_ & 0x00000100) != 0)) {
com.google.protobuf.GeneratedMessage.writeString(output, 7, prefix_);
}
if (((bitField0_ & 0x00000200) != 0)) {
com.google.protobuf.GeneratedMessage.writeString(output, 8, suffix_);
}
if (((bitField0_ & 0x00000400) != 0)) {
com.google.protobuf.GeneratedMessage.writeString(output, 9, contains_);
}
for (int i = 0; i < in_.size(); i++) {
com.google.protobuf.GeneratedMessage.writeString(output, 10, in_.getRaw(i));
}
for (int i = 0; i < notIn_.size(); i++) {
com.google.protobuf.GeneratedMessage.writeString(output, 11, notIn_.getRaw(i));
}
if (wellKnownCase_ == 12) {
output.writeBool(
12, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 13) {
output.writeBool(
13, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 14) {
output.writeBool(
14, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 15) {
output.writeBool(
15, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 16) {
output.writeBool(
16, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 17) {
output.writeBool(
17, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 18) {
output.writeBool(
18, (boolean)((java.lang.Boolean) wellKnown_));
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeUInt64(19, len_);
}
if (((bitField0_ & 0x00000010) != 0)) {
output.writeUInt64(20, lenBytes_);
}
if (wellKnownCase_ == 21) {
output.writeBool(
21, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 22) {
output.writeBool(
22, (boolean)((java.lang.Boolean) wellKnown_));
}
if (((bitField0_ & 0x00000800) != 0)) {
com.google.protobuf.GeneratedMessage.writeString(output, 23, notContains_);
}
if (wellKnownCase_ == 24) {
output.writeEnum(24, ((java.lang.Integer) wellKnown_));
}
if (((bitField0_ & 0x00001000) != 0)) {
output.writeBool(25, strict_);
}
if (wellKnownCase_ == 26) {
output.writeBool(
26, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 27) {
output.writeBool(
27, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 28) {
output.writeBool(
28, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 29) {
output.writeBool(
29, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 30) {
output.writeBool(
30, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 31) {
output.writeBool(
31, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 32) {
output.writeBool(
32, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 33) {
output.writeBool(
33, (boolean)((java.lang.Boolean) wellKnown_));
}
for (int i = 0; i < example_.size(); i++) {
com.google.protobuf.GeneratedMessage.writeString(output, 34, example_.getRaw(i));
}
extensionWriter.writeUntil(536870912, output);
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, const_);
}
if (((bitField0_ & 0x00000004) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(2, minLen_);
}
if (((bitField0_ & 0x00000008) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(3, maxLen_);
}
if (((bitField0_ & 0x00000020) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(4, minBytes_);
}
if (((bitField0_ & 0x00000040) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(5, maxBytes_);
}
if (((bitField0_ & 0x00000080) != 0)) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(6, pattern_);
}
if (((bitField0_ & 0x00000100) != 0)) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(7, prefix_);
}
if (((bitField0_ & 0x00000200) != 0)) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(8, suffix_);
}
if (((bitField0_ & 0x00000400) != 0)) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(9, contains_);
}
{
int dataSize = 0;
for (int i = 0; i < in_.size(); i++) {
dataSize += computeStringSizeNoTag(in_.getRaw(i));
}
size += dataSize;
size += 1 * getInList().size();
}
{
int dataSize = 0;
for (int i = 0; i < notIn_.size(); i++) {
dataSize += computeStringSizeNoTag(notIn_.getRaw(i));
}
size += dataSize;
size += 1 * getNotInList().size();
}
if (wellKnownCase_ == 12) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
12, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 13) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
13, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 14) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
14, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 15) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
15, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 16) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
16, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 17) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
17, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 18) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
18, (boolean)((java.lang.Boolean) wellKnown_));
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(19, len_);
}
if (((bitField0_ & 0x00000010) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(20, lenBytes_);
}
if (wellKnownCase_ == 21) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
21, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 22) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
22, (boolean)((java.lang.Boolean) wellKnown_));
}
if (((bitField0_ & 0x00000800) != 0)) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(23, notContains_);
}
if (wellKnownCase_ == 24) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(24, ((java.lang.Integer) wellKnown_));
}
if (((bitField0_ & 0x00001000) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(25, strict_);
}
if (wellKnownCase_ == 26) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
26, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 27) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
27, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 28) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
28, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 29) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
29, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 30) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
30, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 31) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
31, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 32) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
32, (boolean)((java.lang.Boolean) wellKnown_));
}
if (wellKnownCase_ == 33) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
33, (boolean)((java.lang.Boolean) wellKnown_));
}
{
int dataSize = 0;
for (int i = 0; i < example_.size(); i++) {
dataSize += computeStringSizeNoTag(example_.getRaw(i));
}
size += dataSize;
size += 2 * getExampleList().size();
}
size += extensionsSerializedSize();
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof build.buf.validate.StringRules)) {
return super.equals(obj);
}
build.buf.validate.StringRules other = (build.buf.validate.StringRules) obj;
if (hasConst() != other.hasConst()) return false;
if (hasConst()) {
if (!getConst()
.equals(other.getConst())) return false;
}
if (hasLen() != other.hasLen()) return false;
if (hasLen()) {
if (getLen()
!= other.getLen()) return false;
}
if (hasMinLen() != other.hasMinLen()) return false;
if (hasMinLen()) {
if (getMinLen()
!= other.getMinLen()) return false;
}
if (hasMaxLen() != other.hasMaxLen()) return false;
if (hasMaxLen()) {
if (getMaxLen()
!= other.getMaxLen()) return false;
}
if (hasLenBytes() != other.hasLenBytes()) return false;
if (hasLenBytes()) {
if (getLenBytes()
!= other.getLenBytes()) return false;
}
if (hasMinBytes() != other.hasMinBytes()) return false;
if (hasMinBytes()) {
if (getMinBytes()
!= other.getMinBytes()) return false;
}
if (hasMaxBytes() != other.hasMaxBytes()) return false;
if (hasMaxBytes()) {
if (getMaxBytes()
!= other.getMaxBytes()) return false;
}
if (hasPattern() != other.hasPattern()) return false;
if (hasPattern()) {
if (!getPattern()
.equals(other.getPattern())) return false;
}
if (hasPrefix() != other.hasPrefix()) return false;
if (hasPrefix()) {
if (!getPrefix()
.equals(other.getPrefix())) return false;
}
if (hasSuffix() != other.hasSuffix()) return false;
if (hasSuffix()) {
if (!getSuffix()
.equals(other.getSuffix())) return false;
}
if (hasContains() != other.hasContains()) return false;
if (hasContains()) {
if (!getContains()
.equals(other.getContains())) return false;
}
if (hasNotContains() != other.hasNotContains()) return false;
if (hasNotContains()) {
if (!getNotContains()
.equals(other.getNotContains())) return false;
}
if (!getInList()
.equals(other.getInList())) return false;
if (!getNotInList()
.equals(other.getNotInList())) return false;
if (hasStrict() != other.hasStrict()) return false;
if (hasStrict()) {
if (getStrict()
!= other.getStrict()) return false;
}
if (!getExampleList()
.equals(other.getExampleList())) return false;
if (!getWellKnownCase().equals(other.getWellKnownCase())) return false;
switch (wellKnownCase_) {
case 12:
if (getEmail()
!= other.getEmail()) return false;
break;
case 13:
if (getHostname()
!= other.getHostname()) return false;
break;
case 14:
if (getIp()
!= other.getIp()) return false;
break;
case 15:
if (getIpv4()
!= other.getIpv4()) return false;
break;
case 16:
if (getIpv6()
!= other.getIpv6()) return false;
break;
case 17:
if (getUri()
!= other.getUri()) return false;
break;
case 18:
if (getUriRef()
!= other.getUriRef()) return false;
break;
case 21:
if (getAddress()
!= other.getAddress()) return false;
break;
case 22:
if (getUuid()
!= other.getUuid()) return false;
break;
case 33:
if (getTuuid()
!= other.getTuuid()) return false;
break;
case 26:
if (getIpWithPrefixlen()
!= other.getIpWithPrefixlen()) return false;
break;
case 27:
if (getIpv4WithPrefixlen()
!= other.getIpv4WithPrefixlen()) return false;
break;
case 28:
if (getIpv6WithPrefixlen()
!= other.getIpv6WithPrefixlen()) return false;
break;
case 29:
if (getIpPrefix()
!= other.getIpPrefix()) return false;
break;
case 30:
if (getIpv4Prefix()
!= other.getIpv4Prefix()) return false;
break;
case 31:
if (getIpv6Prefix()
!= other.getIpv6Prefix()) return false;
break;
case 32:
if (getHostAndPort()
!= other.getHostAndPort()) return false;
break;
case 24:
if (!getWellKnownRegex()
.equals(other.getWellKnownRegex())) return false;
break;
case 0:
default:
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
if (!getExtensionFields().equals(other.getExtensionFields()))
return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasConst()) {
hash = (37 * hash) + CONST_FIELD_NUMBER;
hash = (53 * hash) + getConst().hashCode();
}
if (hasLen()) {
hash = (37 * hash) + LEN_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getLen());
}
if (hasMinLen()) {
hash = (37 * hash) + MIN_LEN_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getMinLen());
}
if (hasMaxLen()) {
hash = (37 * hash) + MAX_LEN_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getMaxLen());
}
if (hasLenBytes()) {
hash = (37 * hash) + LEN_BYTES_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getLenBytes());
}
if (hasMinBytes()) {
hash = (37 * hash) + MIN_BYTES_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getMinBytes());
}
if (hasMaxBytes()) {
hash = (37 * hash) + MAX_BYTES_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getMaxBytes());
}
if (hasPattern()) {
hash = (37 * hash) + PATTERN_FIELD_NUMBER;
hash = (53 * hash) + getPattern().hashCode();
}
if (hasPrefix()) {
hash = (37 * hash) + PREFIX_FIELD_NUMBER;
hash = (53 * hash) + getPrefix().hashCode();
}
if (hasSuffix()) {
hash = (37 * hash) + SUFFIX_FIELD_NUMBER;
hash = (53 * hash) + getSuffix().hashCode();
}
if (hasContains()) {
hash = (37 * hash) + CONTAINS_FIELD_NUMBER;
hash = (53 * hash) + getContains().hashCode();
}
if (hasNotContains()) {
hash = (37 * hash) + NOT_CONTAINS_FIELD_NUMBER;
hash = (53 * hash) + getNotContains().hashCode();
}
if (getInCount() > 0) {
hash = (37 * hash) + IN_FIELD_NUMBER;
hash = (53 * hash) + getInList().hashCode();
}
if (getNotInCount() > 0) {
hash = (37 * hash) + NOT_IN_FIELD_NUMBER;
hash = (53 * hash) + getNotInList().hashCode();
}
if (hasStrict()) {
hash = (37 * hash) + STRICT_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getStrict());
}
if (getExampleCount() > 0) {
hash = (37 * hash) + EXAMPLE_FIELD_NUMBER;
hash = (53 * hash) + getExampleList().hashCode();
}
switch (wellKnownCase_) {
case 12:
hash = (37 * hash) + EMAIL_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getEmail());
break;
case 13:
hash = (37 * hash) + HOSTNAME_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getHostname());
break;
case 14:
hash = (37 * hash) + IP_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getIp());
break;
case 15:
hash = (37 * hash) + IPV4_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getIpv4());
break;
case 16:
hash = (37 * hash) + IPV6_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getIpv6());
break;
case 17:
hash = (37 * hash) + URI_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getUri());
break;
case 18:
hash = (37 * hash) + URI_REF_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getUriRef());
break;
case 21:
hash = (37 * hash) + ADDRESS_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getAddress());
break;
case 22:
hash = (37 * hash) + UUID_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getUuid());
break;
case 33:
hash = (37 * hash) + TUUID_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getTuuid());
break;
case 26:
hash = (37 * hash) + IP_WITH_PREFIXLEN_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getIpWithPrefixlen());
break;
case 27:
hash = (37 * hash) + IPV4_WITH_PREFIXLEN_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getIpv4WithPrefixlen());
break;
case 28:
hash = (37 * hash) + IPV6_WITH_PREFIXLEN_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getIpv6WithPrefixlen());
break;
case 29:
hash = (37 * hash) + IP_PREFIX_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getIpPrefix());
break;
case 30:
hash = (37 * hash) + IPV4_PREFIX_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getIpv4Prefix());
break;
case 31:
hash = (37 * hash) + IPV6_PREFIX_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getIpv6Prefix());
break;
case 32:
hash = (37 * hash) + HOST_AND_PORT_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getHostAndPort());
break;
case 24:
hash = (37 * hash) + WELL_KNOWN_REGEX_FIELD_NUMBER;
hash = (53 * hash) + getWellKnownRegex().getNumber();
break;
case 0:
default:
}
hash = hashFields(hash, getExtensionFields());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static build.buf.validate.StringRules parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static build.buf.validate.StringRules parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static build.buf.validate.StringRules parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static build.buf.validate.StringRules parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static build.buf.validate.StringRules parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static build.buf.validate.StringRules parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static build.buf.validate.StringRules parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static build.buf.validate.StringRules parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static build.buf.validate.StringRules parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static build.buf.validate.StringRules parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static build.buf.validate.StringRules parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static build.buf.validate.StringRules parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(build.buf.validate.StringRules prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* StringRules describes the constraints applied to `string` values These
* rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type.
*
*
* Protobuf type {@code buf.validate.StringRules}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.ExtendableBuilder<
build.buf.validate.StringRules, Builder> implements
// @@protoc_insertion_point(builder_implements:buf.validate.StringRules)
build.buf.validate.StringRulesOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return build.buf.validate.ValidateProto.internal_static_buf_validate_StringRules_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return build.buf.validate.ValidateProto.internal_static_buf_validate_StringRules_fieldAccessorTable
.ensureFieldAccessorsInitialized(
build.buf.validate.StringRules.class, build.buf.validate.StringRules.Builder.class);
}
// Construct using build.buf.validate.StringRules.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
bitField1_ = 0;
const_ = "";
len_ = 0L;
minLen_ = 0L;
maxLen_ = 0L;
lenBytes_ = 0L;
minBytes_ = 0L;
maxBytes_ = 0L;
pattern_ = "";
prefix_ = "";
suffix_ = "";
contains_ = "";
notContains_ = "";
in_ =
com.google.protobuf.LazyStringArrayList.emptyList();
notIn_ =
com.google.protobuf.LazyStringArrayList.emptyList();
strict_ = false;
example_ =
com.google.protobuf.LazyStringArrayList.emptyList();
wellKnownCase_ = 0;
wellKnown_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return build.buf.validate.ValidateProto.internal_static_buf_validate_StringRules_descriptor;
}
@java.lang.Override
public build.buf.validate.StringRules getDefaultInstanceForType() {
return build.buf.validate.StringRules.getDefaultInstance();
}
@java.lang.Override
public build.buf.validate.StringRules build() {
build.buf.validate.StringRules result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public build.buf.validate.StringRules buildPartial() {
build.buf.validate.StringRules result = new build.buf.validate.StringRules(this);
if (bitField0_ != 0) { buildPartial0(result); }
if (bitField1_ != 0) { buildPartial1(result); }
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartial0(build.buf.validate.StringRules result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.const_ = const_;
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.len_ = len_;
to_bitField0_ |= 0x00000002;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.minLen_ = minLen_;
to_bitField0_ |= 0x00000004;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.maxLen_ = maxLen_;
to_bitField0_ |= 0x00000008;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.lenBytes_ = lenBytes_;
to_bitField0_ |= 0x00000010;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.minBytes_ = minBytes_;
to_bitField0_ |= 0x00000020;
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.maxBytes_ = maxBytes_;
to_bitField0_ |= 0x00000040;
}
if (((from_bitField0_ & 0x00000080) != 0)) {
result.pattern_ = pattern_;
to_bitField0_ |= 0x00000080;
}
if (((from_bitField0_ & 0x00000100) != 0)) {
result.prefix_ = prefix_;
to_bitField0_ |= 0x00000100;
}
if (((from_bitField0_ & 0x00000200) != 0)) {
result.suffix_ = suffix_;
to_bitField0_ |= 0x00000200;
}
if (((from_bitField0_ & 0x00000400) != 0)) {
result.contains_ = contains_;
to_bitField0_ |= 0x00000400;
}
if (((from_bitField0_ & 0x00000800) != 0)) {
result.notContains_ = notContains_;
to_bitField0_ |= 0x00000800;
}
if (((from_bitField0_ & 0x00001000) != 0)) {
in_.makeImmutable();
result.in_ = in_;
}
if (((from_bitField0_ & 0x00002000) != 0)) {
notIn_.makeImmutable();
result.notIn_ = notIn_;
}
result.bitField0_ |= to_bitField0_;
}
private void buildPartial1(build.buf.validate.StringRules result) {
int from_bitField1_ = bitField1_;
int to_bitField0_ = 0;
if (((from_bitField1_ & 0x00000001) != 0)) {
result.strict_ = strict_;
to_bitField0_ |= 0x00001000;
}
if (((from_bitField1_ & 0x00000002) != 0)) {
example_.makeImmutable();
result.example_ = example_;
}
result.bitField0_ |= to_bitField0_;
}
private void buildPartialOneofs(build.buf.validate.StringRules result) {
result.wellKnownCase_ = wellKnownCase_;
result.wellKnown_ = this.wellKnown_;
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof build.buf.validate.StringRules) {
return mergeFrom((build.buf.validate.StringRules)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(build.buf.validate.StringRules other) {
if (other == build.buf.validate.StringRules.getDefaultInstance()) return this;
if (other.hasConst()) {
const_ = other.const_;
bitField0_ |= 0x00000001;
onChanged();
}
if (other.hasLen()) {
setLen(other.getLen());
}
if (other.hasMinLen()) {
setMinLen(other.getMinLen());
}
if (other.hasMaxLen()) {
setMaxLen(other.getMaxLen());
}
if (other.hasLenBytes()) {
setLenBytes(other.getLenBytes());
}
if (other.hasMinBytes()) {
setMinBytes(other.getMinBytes());
}
if (other.hasMaxBytes()) {
setMaxBytes(other.getMaxBytes());
}
if (other.hasPattern()) {
pattern_ = other.pattern_;
bitField0_ |= 0x00000080;
onChanged();
}
if (other.hasPrefix()) {
prefix_ = other.prefix_;
bitField0_ |= 0x00000100;
onChanged();
}
if (other.hasSuffix()) {
suffix_ = other.suffix_;
bitField0_ |= 0x00000200;
onChanged();
}
if (other.hasContains()) {
contains_ = other.contains_;
bitField0_ |= 0x00000400;
onChanged();
}
if (other.hasNotContains()) {
notContains_ = other.notContains_;
bitField0_ |= 0x00000800;
onChanged();
}
if (!other.in_.isEmpty()) {
if (in_.isEmpty()) {
in_ = other.in_;
bitField0_ |= 0x00001000;
} else {
ensureInIsMutable();
in_.addAll(other.in_);
}
onChanged();
}
if (!other.notIn_.isEmpty()) {
if (notIn_.isEmpty()) {
notIn_ = other.notIn_;
bitField0_ |= 0x00002000;
} else {
ensureNotInIsMutable();
notIn_.addAll(other.notIn_);
}
onChanged();
}
if (other.hasStrict()) {
setStrict(other.getStrict());
}
if (!other.example_.isEmpty()) {
if (example_.isEmpty()) {
example_ = other.example_;
bitField1_ |= 0x00000002;
} else {
ensureExampleIsMutable();
example_.addAll(other.example_);
}
onChanged();
}
switch (other.getWellKnownCase()) {
case EMAIL: {
setEmail(other.getEmail());
break;
}
case HOSTNAME: {
setHostname(other.getHostname());
break;
}
case IP: {
setIp(other.getIp());
break;
}
case IPV4: {
setIpv4(other.getIpv4());
break;
}
case IPV6: {
setIpv6(other.getIpv6());
break;
}
case URI: {
setUri(other.getUri());
break;
}
case URI_REF: {
setUriRef(other.getUriRef());
break;
}
case ADDRESS: {
setAddress(other.getAddress());
break;
}
case UUID: {
setUuid(other.getUuid());
break;
}
case TUUID: {
setTuuid(other.getTuuid());
break;
}
case IP_WITH_PREFIXLEN: {
setIpWithPrefixlen(other.getIpWithPrefixlen());
break;
}
case IPV4_WITH_PREFIXLEN: {
setIpv4WithPrefixlen(other.getIpv4WithPrefixlen());
break;
}
case IPV6_WITH_PREFIXLEN: {
setIpv6WithPrefixlen(other.getIpv6WithPrefixlen());
break;
}
case IP_PREFIX: {
setIpPrefix(other.getIpPrefix());
break;
}
case IPV4_PREFIX: {
setIpv4Prefix(other.getIpv4Prefix());
break;
}
case IPV6_PREFIX: {
setIpv6Prefix(other.getIpv6Prefix());
break;
}
case HOST_AND_PORT: {
setHostAndPort(other.getHostAndPort());
break;
}
case WELL_KNOWN_REGEX: {
setWellKnownRegex(other.getWellKnownRegex());
break;
}
case WELLKNOWN_NOT_SET: {
break;
}
}
this.mergeExtensionFields(other);
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
if (!extensionsAreInitialized()) {
return false;
}
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
const_ = input.readBytes();
bitField0_ |= 0x00000001;
break;
} // case 10
case 16: {
minLen_ = input.readUInt64();
bitField0_ |= 0x00000004;
break;
} // case 16
case 24: {
maxLen_ = input.readUInt64();
bitField0_ |= 0x00000008;
break;
} // case 24
case 32: {
minBytes_ = input.readUInt64();
bitField0_ |= 0x00000020;
break;
} // case 32
case 40: {
maxBytes_ = input.readUInt64();
bitField0_ |= 0x00000040;
break;
} // case 40
case 50: {
pattern_ = input.readBytes();
bitField0_ |= 0x00000080;
break;
} // case 50
case 58: {
prefix_ = input.readBytes();
bitField0_ |= 0x00000100;
break;
} // case 58
case 66: {
suffix_ = input.readBytes();
bitField0_ |= 0x00000200;
break;
} // case 66
case 74: {
contains_ = input.readBytes();
bitField0_ |= 0x00000400;
break;
} // case 74
case 82: {
com.google.protobuf.ByteString bs = input.readBytes();
ensureInIsMutable();
in_.add(bs);
break;
} // case 82
case 90: {
com.google.protobuf.ByteString bs = input.readBytes();
ensureNotInIsMutable();
notIn_.add(bs);
break;
} // case 90
case 96: {
wellKnown_ = input.readBool();
wellKnownCase_ = 12;
break;
} // case 96
case 104: {
wellKnown_ = input.readBool();
wellKnownCase_ = 13;
break;
} // case 104
case 112: {
wellKnown_ = input.readBool();
wellKnownCase_ = 14;
break;
} // case 112
case 120: {
wellKnown_ = input.readBool();
wellKnownCase_ = 15;
break;
} // case 120
case 128: {
wellKnown_ = input.readBool();
wellKnownCase_ = 16;
break;
} // case 128
case 136: {
wellKnown_ = input.readBool();
wellKnownCase_ = 17;
break;
} // case 136
case 144: {
wellKnown_ = input.readBool();
wellKnownCase_ = 18;
break;
} // case 144
case 152: {
len_ = input.readUInt64();
bitField0_ |= 0x00000002;
break;
} // case 152
case 160: {
lenBytes_ = input.readUInt64();
bitField0_ |= 0x00000010;
break;
} // case 160
case 168: {
wellKnown_ = input.readBool();
wellKnownCase_ = 21;
break;
} // case 168
case 176: {
wellKnown_ = input.readBool();
wellKnownCase_ = 22;
break;
} // case 176
case 186: {
notContains_ = input.readBytes();
bitField0_ |= 0x00000800;
break;
} // case 186
case 192: {
int rawValue = input.readEnum();
build.buf.validate.KnownRegex value =
build.buf.validate.KnownRegex.forNumber(rawValue);
if (value == null) {
mergeUnknownVarintField(24, rawValue);
} else {
wellKnownCase_ = 24;
wellKnown_ = rawValue;
}
break;
} // case 192
case 200: {
strict_ = input.readBool();
bitField1_ |= 0x00000001;
break;
} // case 200
case 208: {
wellKnown_ = input.readBool();
wellKnownCase_ = 26;
break;
} // case 208
case 216: {
wellKnown_ = input.readBool();
wellKnownCase_ = 27;
break;
} // case 216
case 224: {
wellKnown_ = input.readBool();
wellKnownCase_ = 28;
break;
} // case 224
case 232: {
wellKnown_ = input.readBool();
wellKnownCase_ = 29;
break;
} // case 232
case 240: {
wellKnown_ = input.readBool();
wellKnownCase_ = 30;
break;
} // case 240
case 248: {
wellKnown_ = input.readBool();
wellKnownCase_ = 31;
break;
} // case 248
case 256: {
wellKnown_ = input.readBool();
wellKnownCase_ = 32;
break;
} // case 256
case 264: {
wellKnown_ = input.readBool();
wellKnownCase_ = 33;
break;
} // case 264
case 274: {
com.google.protobuf.ByteString bs = input.readBytes();
ensureExampleIsMutable();
example_.add(bs);
break;
} // case 274
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int wellKnownCase_ = 0;
private java.lang.Object wellKnown_;
public WellKnownCase
getWellKnownCase() {
return WellKnownCase.forNumber(
wellKnownCase_);
}
public Builder clearWellKnown() {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
return this;
}
private int bitField0_;
private int bitField1_;
private java.lang.Object const_ = "";
/**
*
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MyString {
* // value must equal `hello`
* string value = 1 [(buf.validate.field).string.const = "hello"];
* }
* ```
*
*
* optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... }
* @return Whether the const field is set.
*/
public boolean hasConst() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MyString {
* // value must equal `hello`
* string value = 1 [(buf.validate.field).string.const = "hello"];
* }
* ```
*
*
* optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... }
* @return The const.
*/
public java.lang.String getConst() {
java.lang.Object ref = const_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
const_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MyString {
* // value must equal `hello`
* string value = 1 [(buf.validate.field).string.const = "hello"];
* }
* ```
*
*
* optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... }
* @return The bytes for const.
*/
public com.google.protobuf.ByteString
getConstBytes() {
java.lang.Object ref = const_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
const_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MyString {
* // value must equal `hello`
* string value = 1 [(buf.validate.field).string.const = "hello"];
* }
* ```
*
*
* optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... }
* @param value The const to set.
* @return This builder for chaining.
*/
public Builder setConst(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
const_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MyString {
* // value must equal `hello`
* string value = 1 [(buf.validate.field).string.const = "hello"];
* }
* ```
*
*
* optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearConst() {
const_ = getDefaultInstance().getConst();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MyString {
* // value must equal `hello`
* string value = 1 [(buf.validate.field).string.const = "hello"];
* }
* ```
*
*
* optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... }
* @param value The bytes for const to set.
* @return This builder for chaining.
*/
public Builder setConstBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
const_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private long len_ ;
/**
*
* `len` dictates that the field value must have the specified
* number of characters (Unicode code points), which may differ from the number
* of bytes in the string. If the field value does not meet the specified
* length, an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be 5 characters
* string value = 1 [(buf.validate.field).string.len = 5];
* }
* ```
*
*
* optional uint64 len = 19 [json_name = "len", (.buf.validate.predefined) = { ... }
* @return Whether the len field is set.
*/
@java.lang.Override
public boolean hasLen() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* `len` dictates that the field value must have the specified
* number of characters (Unicode code points), which may differ from the number
* of bytes in the string. If the field value does not meet the specified
* length, an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be 5 characters
* string value = 1 [(buf.validate.field).string.len = 5];
* }
* ```
*
*
* optional uint64 len = 19 [json_name = "len", (.buf.validate.predefined) = { ... }
* @return The len.
*/
@java.lang.Override
public long getLen() {
return len_;
}
/**
*
* `len` dictates that the field value must have the specified
* number of characters (Unicode code points), which may differ from the number
* of bytes in the string. If the field value does not meet the specified
* length, an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be 5 characters
* string value = 1 [(buf.validate.field).string.len = 5];
* }
* ```
*
*
* optional uint64 len = 19 [json_name = "len", (.buf.validate.predefined) = { ... }
* @param value The len to set.
* @return This builder for chaining.
*/
public Builder setLen(long value) {
len_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* `len` dictates that the field value must have the specified
* number of characters (Unicode code points), which may differ from the number
* of bytes in the string. If the field value does not meet the specified
* length, an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be 5 characters
* string value = 1 [(buf.validate.field).string.len = 5];
* }
* ```
*
*
* optional uint64 len = 19 [json_name = "len", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearLen() {
bitField0_ = (bitField0_ & ~0x00000002);
len_ = 0L;
onChanged();
return this;
}
private long minLen_ ;
/**
*
* `min_len` specifies that the field value must have at least the specified
* number of characters (Unicode code points), which may differ from the number
* of bytes in the string. If the field value contains fewer characters, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value length must be at least 3 characters
* string value = 1 [(buf.validate.field).string.min_len = 3];
* }
* ```
*
*
* optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... }
* @return Whether the minLen field is set.
*/
@java.lang.Override
public boolean hasMinLen() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
* `min_len` specifies that the field value must have at least the specified
* number of characters (Unicode code points), which may differ from the number
* of bytes in the string. If the field value contains fewer characters, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value length must be at least 3 characters
* string value = 1 [(buf.validate.field).string.min_len = 3];
* }
* ```
*
*
* optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... }
* @return The minLen.
*/
@java.lang.Override
public long getMinLen() {
return minLen_;
}
/**
*
* `min_len` specifies that the field value must have at least the specified
* number of characters (Unicode code points), which may differ from the number
* of bytes in the string. If the field value contains fewer characters, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value length must be at least 3 characters
* string value = 1 [(buf.validate.field).string.min_len = 3];
* }
* ```
*
*
* optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... }
* @param value The minLen to set.
* @return This builder for chaining.
*/
public Builder setMinLen(long value) {
minLen_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* `min_len` specifies that the field value must have at least the specified
* number of characters (Unicode code points), which may differ from the number
* of bytes in the string. If the field value contains fewer characters, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value length must be at least 3 characters
* string value = 1 [(buf.validate.field).string.min_len = 3];
* }
* ```
*
*
* optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearMinLen() {
bitField0_ = (bitField0_ & ~0x00000004);
minLen_ = 0L;
onChanged();
return this;
}
private long maxLen_ ;
/**
*
* `max_len` specifies that the field value must have no more than the specified
* number of characters (Unicode code points), which may differ from the
* number of bytes in the string. If the field value contains more characters,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be at most 10 characters
* string value = 1 [(buf.validate.field).string.max_len = 10];
* }
* ```
*
*
* optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... }
* @return Whether the maxLen field is set.
*/
@java.lang.Override
public boolean hasMaxLen() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
* `max_len` specifies that the field value must have no more than the specified
* number of characters (Unicode code points), which may differ from the
* number of bytes in the string. If the field value contains more characters,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be at most 10 characters
* string value = 1 [(buf.validate.field).string.max_len = 10];
* }
* ```
*
*
* optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... }
* @return The maxLen.
*/
@java.lang.Override
public long getMaxLen() {
return maxLen_;
}
/**
*
* `max_len` specifies that the field value must have no more than the specified
* number of characters (Unicode code points), which may differ from the
* number of bytes in the string. If the field value contains more characters,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be at most 10 characters
* string value = 1 [(buf.validate.field).string.max_len = 10];
* }
* ```
*
*
* optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... }
* @param value The maxLen to set.
* @return This builder for chaining.
*/
public Builder setMaxLen(long value) {
maxLen_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* `max_len` specifies that the field value must have no more than the specified
* number of characters (Unicode code points), which may differ from the
* number of bytes in the string. If the field value contains more characters,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be at most 10 characters
* string value = 1 [(buf.validate.field).string.max_len = 10];
* }
* ```
*
*
* optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearMaxLen() {
bitField0_ = (bitField0_ & ~0x00000008);
maxLen_ = 0L;
onChanged();
return this;
}
private long lenBytes_ ;
/**
*
* `len_bytes` dictates that the field value must have the specified number of
* bytes. If the field value does not match the specified length in bytes,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be 6 bytes
* string value = 1 [(buf.validate.field).string.len_bytes = 6];
* }
* ```
*
*
* optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.predefined) = { ... }
* @return Whether the lenBytes field is set.
*/
@java.lang.Override
public boolean hasLenBytes() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
*
* `len_bytes` dictates that the field value must have the specified number of
* bytes. If the field value does not match the specified length in bytes,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be 6 bytes
* string value = 1 [(buf.validate.field).string.len_bytes = 6];
* }
* ```
*
*
* optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.predefined) = { ... }
* @return The lenBytes.
*/
@java.lang.Override
public long getLenBytes() {
return lenBytes_;
}
/**
*
* `len_bytes` dictates that the field value must have the specified number of
* bytes. If the field value does not match the specified length in bytes,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be 6 bytes
* string value = 1 [(buf.validate.field).string.len_bytes = 6];
* }
* ```
*
*
* optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.predefined) = { ... }
* @param value The lenBytes to set.
* @return This builder for chaining.
*/
public Builder setLenBytes(long value) {
lenBytes_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
* `len_bytes` dictates that the field value must have the specified number of
* bytes. If the field value does not match the specified length in bytes,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value length must be 6 bytes
* string value = 1 [(buf.validate.field).string.len_bytes = 6];
* }
* ```
*
*
* optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearLenBytes() {
bitField0_ = (bitField0_ & ~0x00000010);
lenBytes_ = 0L;
onChanged();
return this;
}
private long minBytes_ ;
/**
*
* `min_bytes` specifies that the field value must have at least the specified
* number of bytes. If the field value contains fewer bytes, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value length must be at least 4 bytes
* string value = 1 [(buf.validate.field).string.min_bytes = 4];
* }
*
* ```
*
*
* optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.predefined) = { ... }
* @return Whether the minBytes field is set.
*/
@java.lang.Override
public boolean hasMinBytes() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
*
* `min_bytes` specifies that the field value must have at least the specified
* number of bytes. If the field value contains fewer bytes, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value length must be at least 4 bytes
* string value = 1 [(buf.validate.field).string.min_bytes = 4];
* }
*
* ```
*
*
* optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.predefined) = { ... }
* @return The minBytes.
*/
@java.lang.Override
public long getMinBytes() {
return minBytes_;
}
/**
*
* `min_bytes` specifies that the field value must have at least the specified
* number of bytes. If the field value contains fewer bytes, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value length must be at least 4 bytes
* string value = 1 [(buf.validate.field).string.min_bytes = 4];
* }
*
* ```
*
*
* optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.predefined) = { ... }
* @param value The minBytes to set.
* @return This builder for chaining.
*/
public Builder setMinBytes(long value) {
minBytes_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
* `min_bytes` specifies that the field value must have at least the specified
* number of bytes. If the field value contains fewer bytes, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value length must be at least 4 bytes
* string value = 1 [(buf.validate.field).string.min_bytes = 4];
* }
*
* ```
*
*
* optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearMinBytes() {
bitField0_ = (bitField0_ & ~0x00000020);
minBytes_ = 0L;
onChanged();
return this;
}
private long maxBytes_ ;
/**
*
* `max_bytes` specifies that the field value must have no more than the
* specified number of bytes. If the field value contains more bytes, an
* error message will be generated.
*
* ```proto
* message MyString {
* // value length must be at most 8 bytes
* string value = 1 [(buf.validate.field).string.max_bytes = 8];
* }
* ```
*
*
* optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.predefined) = { ... }
* @return Whether the maxBytes field is set.
*/
@java.lang.Override
public boolean hasMaxBytes() {
return ((bitField0_ & 0x00000040) != 0);
}
/**
*
* `max_bytes` specifies that the field value must have no more than the
* specified number of bytes. If the field value contains more bytes, an
* error message will be generated.
*
* ```proto
* message MyString {
* // value length must be at most 8 bytes
* string value = 1 [(buf.validate.field).string.max_bytes = 8];
* }
* ```
*
*
* optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.predefined) = { ... }
* @return The maxBytes.
*/
@java.lang.Override
public long getMaxBytes() {
return maxBytes_;
}
/**
*
* `max_bytes` specifies that the field value must have no more than the
* specified number of bytes. If the field value contains more bytes, an
* error message will be generated.
*
* ```proto
* message MyString {
* // value length must be at most 8 bytes
* string value = 1 [(buf.validate.field).string.max_bytes = 8];
* }
* ```
*
*
* optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.predefined) = { ... }
* @param value The maxBytes to set.
* @return This builder for chaining.
*/
public Builder setMaxBytes(long value) {
maxBytes_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
* `max_bytes` specifies that the field value must have no more than the
* specified number of bytes. If the field value contains more bytes, an
* error message will be generated.
*
* ```proto
* message MyString {
* // value length must be at most 8 bytes
* string value = 1 [(buf.validate.field).string.max_bytes = 8];
* }
* ```
*
*
* optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearMaxBytes() {
bitField0_ = (bitField0_ & ~0x00000040);
maxBytes_ = 0L;
onChanged();
return this;
}
private java.lang.Object pattern_ = "";
/**
*
* `pattern` specifies that the field value must match the specified
* regular expression (RE2 syntax), with the expression provided without any
* delimiters. If the field value doesn't match the regular expression, an
* error message will be generated.
*
* ```proto
* message MyString {
* // value does not match regex pattern `^[a-zA-Z]//$`
* string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"];
* }
* ```
*
*
* optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... }
* @return Whether the pattern field is set.
*/
public boolean hasPattern() {
return ((bitField0_ & 0x00000080) != 0);
}
/**
*
* `pattern` specifies that the field value must match the specified
* regular expression (RE2 syntax), with the expression provided without any
* delimiters. If the field value doesn't match the regular expression, an
* error message will be generated.
*
* ```proto
* message MyString {
* // value does not match regex pattern `^[a-zA-Z]//$`
* string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"];
* }
* ```
*
*
* optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... }
* @return The pattern.
*/
public java.lang.String getPattern() {
java.lang.Object ref = pattern_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
pattern_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* `pattern` specifies that the field value must match the specified
* regular expression (RE2 syntax), with the expression provided without any
* delimiters. If the field value doesn't match the regular expression, an
* error message will be generated.
*
* ```proto
* message MyString {
* // value does not match regex pattern `^[a-zA-Z]//$`
* string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"];
* }
* ```
*
*
* optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... }
* @return The bytes for pattern.
*/
public com.google.protobuf.ByteString
getPatternBytes() {
java.lang.Object ref = pattern_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
pattern_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* `pattern` specifies that the field value must match the specified
* regular expression (RE2 syntax), with the expression provided without any
* delimiters. If the field value doesn't match the regular expression, an
* error message will be generated.
*
* ```proto
* message MyString {
* // value does not match regex pattern `^[a-zA-Z]//$`
* string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"];
* }
* ```
*
*
* optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... }
* @param value The pattern to set.
* @return This builder for chaining.
*/
public Builder setPattern(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
pattern_ = value;
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
*
* `pattern` specifies that the field value must match the specified
* regular expression (RE2 syntax), with the expression provided without any
* delimiters. If the field value doesn't match the regular expression, an
* error message will be generated.
*
* ```proto
* message MyString {
* // value does not match regex pattern `^[a-zA-Z]//$`
* string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"];
* }
* ```
*
*
* optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearPattern() {
pattern_ = getDefaultInstance().getPattern();
bitField0_ = (bitField0_ & ~0x00000080);
onChanged();
return this;
}
/**
*
* `pattern` specifies that the field value must match the specified
* regular expression (RE2 syntax), with the expression provided without any
* delimiters. If the field value doesn't match the regular expression, an
* error message will be generated.
*
* ```proto
* message MyString {
* // value does not match regex pattern `^[a-zA-Z]//$`
* string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"];
* }
* ```
*
*
* optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... }
* @param value The bytes for pattern to set.
* @return This builder for chaining.
*/
public Builder setPatternBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
pattern_ = value;
bitField0_ |= 0x00000080;
onChanged();
return this;
}
private java.lang.Object prefix_ = "";
/**
*
* `prefix` specifies that the field value must have the
* specified substring at the beginning of the string. If the field value
* doesn't start with the specified prefix, an error message will be
* generated.
*
* ```proto
* message MyString {
* // value does not have prefix `pre`
* string value = 1 [(buf.validate.field).string.prefix = "pre"];
* }
* ```
*
*
* optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... }
* @return Whether the prefix field is set.
*/
public boolean hasPrefix() {
return ((bitField0_ & 0x00000100) != 0);
}
/**
*
* `prefix` specifies that the field value must have the
* specified substring at the beginning of the string. If the field value
* doesn't start with the specified prefix, an error message will be
* generated.
*
* ```proto
* message MyString {
* // value does not have prefix `pre`
* string value = 1 [(buf.validate.field).string.prefix = "pre"];
* }
* ```
*
*
* optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... }
* @return The prefix.
*/
public java.lang.String getPrefix() {
java.lang.Object ref = prefix_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
prefix_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* `prefix` specifies that the field value must have the
* specified substring at the beginning of the string. If the field value
* doesn't start with the specified prefix, an error message will be
* generated.
*
* ```proto
* message MyString {
* // value does not have prefix `pre`
* string value = 1 [(buf.validate.field).string.prefix = "pre"];
* }
* ```
*
*
* optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... }
* @return The bytes for prefix.
*/
public com.google.protobuf.ByteString
getPrefixBytes() {
java.lang.Object ref = prefix_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
prefix_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* `prefix` specifies that the field value must have the
* specified substring at the beginning of the string. If the field value
* doesn't start with the specified prefix, an error message will be
* generated.
*
* ```proto
* message MyString {
* // value does not have prefix `pre`
* string value = 1 [(buf.validate.field).string.prefix = "pre"];
* }
* ```
*
*
* optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... }
* @param value The prefix to set.
* @return This builder for chaining.
*/
public Builder setPrefix(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
prefix_ = value;
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
* `prefix` specifies that the field value must have the
* specified substring at the beginning of the string. If the field value
* doesn't start with the specified prefix, an error message will be
* generated.
*
* ```proto
* message MyString {
* // value does not have prefix `pre`
* string value = 1 [(buf.validate.field).string.prefix = "pre"];
* }
* ```
*
*
* optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearPrefix() {
prefix_ = getDefaultInstance().getPrefix();
bitField0_ = (bitField0_ & ~0x00000100);
onChanged();
return this;
}
/**
*
* `prefix` specifies that the field value must have the
* specified substring at the beginning of the string. If the field value
* doesn't start with the specified prefix, an error message will be
* generated.
*
* ```proto
* message MyString {
* // value does not have prefix `pre`
* string value = 1 [(buf.validate.field).string.prefix = "pre"];
* }
* ```
*
*
* optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... }
* @param value The bytes for prefix to set.
* @return This builder for chaining.
*/
public Builder setPrefixBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
prefix_ = value;
bitField0_ |= 0x00000100;
onChanged();
return this;
}
private java.lang.Object suffix_ = "";
/**
*
* `suffix` specifies that the field value must have the
* specified substring at the end of the string. If the field value doesn't
* end with the specified suffix, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not have suffix `post`
* string value = 1 [(buf.validate.field).string.suffix = "post"];
* }
* ```
*
*
* optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... }
* @return Whether the suffix field is set.
*/
public boolean hasSuffix() {
return ((bitField0_ & 0x00000200) != 0);
}
/**
*
* `suffix` specifies that the field value must have the
* specified substring at the end of the string. If the field value doesn't
* end with the specified suffix, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not have suffix `post`
* string value = 1 [(buf.validate.field).string.suffix = "post"];
* }
* ```
*
*
* optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... }
* @return The suffix.
*/
public java.lang.String getSuffix() {
java.lang.Object ref = suffix_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
suffix_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* `suffix` specifies that the field value must have the
* specified substring at the end of the string. If the field value doesn't
* end with the specified suffix, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not have suffix `post`
* string value = 1 [(buf.validate.field).string.suffix = "post"];
* }
* ```
*
*
* optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... }
* @return The bytes for suffix.
*/
public com.google.protobuf.ByteString
getSuffixBytes() {
java.lang.Object ref = suffix_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
suffix_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* `suffix` specifies that the field value must have the
* specified substring at the end of the string. If the field value doesn't
* end with the specified suffix, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not have suffix `post`
* string value = 1 [(buf.validate.field).string.suffix = "post"];
* }
* ```
*
*
* optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... }
* @param value The suffix to set.
* @return This builder for chaining.
*/
public Builder setSuffix(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
suffix_ = value;
bitField0_ |= 0x00000200;
onChanged();
return this;
}
/**
*
* `suffix` specifies that the field value must have the
* specified substring at the end of the string. If the field value doesn't
* end with the specified suffix, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not have suffix `post`
* string value = 1 [(buf.validate.field).string.suffix = "post"];
* }
* ```
*
*
* optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearSuffix() {
suffix_ = getDefaultInstance().getSuffix();
bitField0_ = (bitField0_ & ~0x00000200);
onChanged();
return this;
}
/**
*
* `suffix` specifies that the field value must have the
* specified substring at the end of the string. If the field value doesn't
* end with the specified suffix, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not have suffix `post`
* string value = 1 [(buf.validate.field).string.suffix = "post"];
* }
* ```
*
*
* optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... }
* @param value The bytes for suffix to set.
* @return This builder for chaining.
*/
public Builder setSuffixBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
suffix_ = value;
bitField0_ |= 0x00000200;
onChanged();
return this;
}
private java.lang.Object contains_ = "";
/**
*
* `contains` specifies that the field value must have the
* specified substring anywhere in the string. If the field value doesn't
* contain the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not contain substring `inside`.
* string value = 1 [(buf.validate.field).string.contains = "inside"];
* }
* ```
*
*
* optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... }
* @return Whether the contains field is set.
*/
public boolean hasContains() {
return ((bitField0_ & 0x00000400) != 0);
}
/**
*
* `contains` specifies that the field value must have the
* specified substring anywhere in the string. If the field value doesn't
* contain the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not contain substring `inside`.
* string value = 1 [(buf.validate.field).string.contains = "inside"];
* }
* ```
*
*
* optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... }
* @return The contains.
*/
public java.lang.String getContains() {
java.lang.Object ref = contains_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
contains_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* `contains` specifies that the field value must have the
* specified substring anywhere in the string. If the field value doesn't
* contain the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not contain substring `inside`.
* string value = 1 [(buf.validate.field).string.contains = "inside"];
* }
* ```
*
*
* optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... }
* @return The bytes for contains.
*/
public com.google.protobuf.ByteString
getContainsBytes() {
java.lang.Object ref = contains_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
contains_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* `contains` specifies that the field value must have the
* specified substring anywhere in the string. If the field value doesn't
* contain the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not contain substring `inside`.
* string value = 1 [(buf.validate.field).string.contains = "inside"];
* }
* ```
*
*
* optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... }
* @param value The contains to set.
* @return This builder for chaining.
*/
public Builder setContains(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
contains_ = value;
bitField0_ |= 0x00000400;
onChanged();
return this;
}
/**
*
* `contains` specifies that the field value must have the
* specified substring anywhere in the string. If the field value doesn't
* contain the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not contain substring `inside`.
* string value = 1 [(buf.validate.field).string.contains = "inside"];
* }
* ```
*
*
* optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearContains() {
contains_ = getDefaultInstance().getContains();
bitField0_ = (bitField0_ & ~0x00000400);
onChanged();
return this;
}
/**
*
* `contains` specifies that the field value must have the
* specified substring anywhere in the string. If the field value doesn't
* contain the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value does not contain substring `inside`.
* string value = 1 [(buf.validate.field).string.contains = "inside"];
* }
* ```
*
*
* optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... }
* @param value The bytes for contains to set.
* @return This builder for chaining.
*/
public Builder setContainsBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
contains_ = value;
bitField0_ |= 0x00000400;
onChanged();
return this;
}
private java.lang.Object notContains_ = "";
/**
*
* `not_contains` specifies that the field value must not have the
* specified substring anywhere in the string. If the field value contains
* the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value contains substring `inside`.
* string value = 1 [(buf.validate.field).string.not_contains = "inside"];
* }
* ```
*
*
* optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... }
* @return Whether the notContains field is set.
*/
public boolean hasNotContains() {
return ((bitField0_ & 0x00000800) != 0);
}
/**
*
* `not_contains` specifies that the field value must not have the
* specified substring anywhere in the string. If the field value contains
* the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value contains substring `inside`.
* string value = 1 [(buf.validate.field).string.not_contains = "inside"];
* }
* ```
*
*
* optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... }
* @return The notContains.
*/
public java.lang.String getNotContains() {
java.lang.Object ref = notContains_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
notContains_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* `not_contains` specifies that the field value must not have the
* specified substring anywhere in the string. If the field value contains
* the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value contains substring `inside`.
* string value = 1 [(buf.validate.field).string.not_contains = "inside"];
* }
* ```
*
*
* optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... }
* @return The bytes for notContains.
*/
public com.google.protobuf.ByteString
getNotContainsBytes() {
java.lang.Object ref = notContains_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
notContains_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* `not_contains` specifies that the field value must not have the
* specified substring anywhere in the string. If the field value contains
* the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value contains substring `inside`.
* string value = 1 [(buf.validate.field).string.not_contains = "inside"];
* }
* ```
*
*
* optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... }
* @param value The notContains to set.
* @return This builder for chaining.
*/
public Builder setNotContains(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
notContains_ = value;
bitField0_ |= 0x00000800;
onChanged();
return this;
}
/**
*
* `not_contains` specifies that the field value must not have the
* specified substring anywhere in the string. If the field value contains
* the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value contains substring `inside`.
* string value = 1 [(buf.validate.field).string.not_contains = "inside"];
* }
* ```
*
*
* optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearNotContains() {
notContains_ = getDefaultInstance().getNotContains();
bitField0_ = (bitField0_ & ~0x00000800);
onChanged();
return this;
}
/**
*
* `not_contains` specifies that the field value must not have the
* specified substring anywhere in the string. If the field value contains
* the specified substring, an error message will be generated.
*
* ```proto
* message MyString {
* // value contains substring `inside`.
* string value = 1 [(buf.validate.field).string.not_contains = "inside"];
* }
* ```
*
*
* optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... }
* @param value The bytes for notContains to set.
* @return This builder for chaining.
*/
public Builder setNotContainsBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
notContains_ = value;
bitField0_ |= 0x00000800;
onChanged();
return this;
}
private com.google.protobuf.LazyStringArrayList in_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureInIsMutable() {
if (!in_.isModifiable()) {
in_ = new com.google.protobuf.LazyStringArrayList(in_);
}
bitField0_ |= 0x00001000;
}
/**
*
* `in` specifies that the field value must be equal to one of the specified
* values. If the field value isn't one of the specified values, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be in list ["apple", "banana"]
* repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
* }
* ```
*
*
* repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... }
* @return A list containing the in.
*/
public com.google.protobuf.ProtocolStringList
getInList() {
in_.makeImmutable();
return in_;
}
/**
*
* `in` specifies that the field value must be equal to one of the specified
* values. If the field value isn't one of the specified values, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be in list ["apple", "banana"]
* repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
* }
* ```
*
*
* repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... }
* @return The count of in.
*/
public int getInCount() {
return in_.size();
}
/**
*
* `in` specifies that the field value must be equal to one of the specified
* values. If the field value isn't one of the specified values, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be in list ["apple", "banana"]
* repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
* }
* ```
*
*
* repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... }
* @param index The index of the element to return.
* @return The in at the given index.
*/
public java.lang.String getIn(int index) {
return in_.get(index);
}
/**
*
* `in` specifies that the field value must be equal to one of the specified
* values. If the field value isn't one of the specified values, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be in list ["apple", "banana"]
* repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
* }
* ```
*
*
* repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... }
* @param index The index of the value to return.
* @return The bytes of the in at the given index.
*/
public com.google.protobuf.ByteString
getInBytes(int index) {
return in_.getByteString(index);
}
/**
*
* `in` specifies that the field value must be equal to one of the specified
* values. If the field value isn't one of the specified values, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be in list ["apple", "banana"]
* repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
* }
* ```
*
*
* repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... }
* @param index The index to set the value at.
* @param value The in to set.
* @return This builder for chaining.
*/
public Builder setIn(
int index, java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensureInIsMutable();
in_.set(index, value);
bitField0_ |= 0x00001000;
onChanged();
return this;
}
/**
*
* `in` specifies that the field value must be equal to one of the specified
* values. If the field value isn't one of the specified values, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be in list ["apple", "banana"]
* repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
* }
* ```
*
*
* repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... }
* @param value The in to add.
* @return This builder for chaining.
*/
public Builder addIn(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensureInIsMutable();
in_.add(value);
bitField0_ |= 0x00001000;
onChanged();
return this;
}
/**
*
* `in` specifies that the field value must be equal to one of the specified
* values. If the field value isn't one of the specified values, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be in list ["apple", "banana"]
* repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
* }
* ```
*
*
* repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... }
* @param values The in to add.
* @return This builder for chaining.
*/
public Builder addAllIn(
java.lang.Iterable values) {
ensureInIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, in_);
bitField0_ |= 0x00001000;
onChanged();
return this;
}
/**
*
* `in` specifies that the field value must be equal to one of the specified
* values. If the field value isn't one of the specified values, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be in list ["apple", "banana"]
* repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
* }
* ```
*
*
* repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearIn() {
in_ =
com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00001000);;
onChanged();
return this;
}
/**
*
* `in` specifies that the field value must be equal to one of the specified
* values. If the field value isn't one of the specified values, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be in list ["apple", "banana"]
* repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
* }
* ```
*
*
* repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... }
* @param value The bytes of the in to add.
* @return This builder for chaining.
*/
public Builder addInBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
ensureInIsMutable();
in_.add(value);
bitField0_ |= 0x00001000;
onChanged();
return this;
}
private com.google.protobuf.LazyStringArrayList notIn_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureNotInIsMutable() {
if (!notIn_.isModifiable()) {
notIn_ = new com.google.protobuf.LazyStringArrayList(notIn_);
}
bitField0_ |= 0x00002000;
}
/**
*
* `not_in` specifies that the field value cannot be equal to any
* of the specified values. If the field value is one of the specified values,
* an error message will be generated.
* ```proto
* message MyString {
* // value must not be in list ["orange", "grape"]
* repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
* }
* ```
*
*
* repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... }
* @return A list containing the notIn.
*/
public com.google.protobuf.ProtocolStringList
getNotInList() {
notIn_.makeImmutable();
return notIn_;
}
/**
*
* `not_in` specifies that the field value cannot be equal to any
* of the specified values. If the field value is one of the specified values,
* an error message will be generated.
* ```proto
* message MyString {
* // value must not be in list ["orange", "grape"]
* repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
* }
* ```
*
*
* repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... }
* @return The count of notIn.
*/
public int getNotInCount() {
return notIn_.size();
}
/**
*
* `not_in` specifies that the field value cannot be equal to any
* of the specified values. If the field value is one of the specified values,
* an error message will be generated.
* ```proto
* message MyString {
* // value must not be in list ["orange", "grape"]
* repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
* }
* ```
*
*
* repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... }
* @param index The index of the element to return.
* @return The notIn at the given index.
*/
public java.lang.String getNotIn(int index) {
return notIn_.get(index);
}
/**
*
* `not_in` specifies that the field value cannot be equal to any
* of the specified values. If the field value is one of the specified values,
* an error message will be generated.
* ```proto
* message MyString {
* // value must not be in list ["orange", "grape"]
* repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
* }
* ```
*
*
* repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... }
* @param index The index of the value to return.
* @return The bytes of the notIn at the given index.
*/
public com.google.protobuf.ByteString
getNotInBytes(int index) {
return notIn_.getByteString(index);
}
/**
*
* `not_in` specifies that the field value cannot be equal to any
* of the specified values. If the field value is one of the specified values,
* an error message will be generated.
* ```proto
* message MyString {
* // value must not be in list ["orange", "grape"]
* repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
* }
* ```
*
*
* repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... }
* @param index The index to set the value at.
* @param value The notIn to set.
* @return This builder for chaining.
*/
public Builder setNotIn(
int index, java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensureNotInIsMutable();
notIn_.set(index, value);
bitField0_ |= 0x00002000;
onChanged();
return this;
}
/**
*
* `not_in` specifies that the field value cannot be equal to any
* of the specified values. If the field value is one of the specified values,
* an error message will be generated.
* ```proto
* message MyString {
* // value must not be in list ["orange", "grape"]
* repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
* }
* ```
*
*
* repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... }
* @param value The notIn to add.
* @return This builder for chaining.
*/
public Builder addNotIn(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensureNotInIsMutable();
notIn_.add(value);
bitField0_ |= 0x00002000;
onChanged();
return this;
}
/**
*
* `not_in` specifies that the field value cannot be equal to any
* of the specified values. If the field value is one of the specified values,
* an error message will be generated.
* ```proto
* message MyString {
* // value must not be in list ["orange", "grape"]
* repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
* }
* ```
*
*
* repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... }
* @param values The notIn to add.
* @return This builder for chaining.
*/
public Builder addAllNotIn(
java.lang.Iterable values) {
ensureNotInIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, notIn_);
bitField0_ |= 0x00002000;
onChanged();
return this;
}
/**
*
* `not_in` specifies that the field value cannot be equal to any
* of the specified values. If the field value is one of the specified values,
* an error message will be generated.
* ```proto
* message MyString {
* // value must not be in list ["orange", "grape"]
* repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
* }
* ```
*
*
* repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearNotIn() {
notIn_ =
com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00002000);;
onChanged();
return this;
}
/**
*
* `not_in` specifies that the field value cannot be equal to any
* of the specified values. If the field value is one of the specified values,
* an error message will be generated.
* ```proto
* message MyString {
* // value must not be in list ["orange", "grape"]
* repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
* }
* ```
*
*
* repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... }
* @param value The bytes of the notIn to add.
* @return This builder for chaining.
*/
public Builder addNotInBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
ensureNotInIsMutable();
notIn_.add(value);
bitField0_ |= 0x00002000;
onChanged();
return this;
}
/**
*
* `email` specifies that the field value must be a valid email address
* (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1).
* If the field value isn't a valid email address, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid email address
* string value = 1 [(buf.validate.field).string.email = true];
* }
* ```
*
*
* bool email = 12 [json_name = "email", (.buf.validate.predefined) = { ... }
* @return Whether the email field is set.
*/
public boolean hasEmail() {
return wellKnownCase_ == 12;
}
/**
*
* `email` specifies that the field value must be a valid email address
* (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1).
* If the field value isn't a valid email address, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid email address
* string value = 1 [(buf.validate.field).string.email = true];
* }
* ```
*
*
* bool email = 12 [json_name = "email", (.buf.validate.predefined) = { ... }
* @return The email.
*/
public boolean getEmail() {
if (wellKnownCase_ == 12) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `email` specifies that the field value must be a valid email address
* (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1).
* If the field value isn't a valid email address, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid email address
* string value = 1 [(buf.validate.field).string.email = true];
* }
* ```
*
*
* bool email = 12 [json_name = "email", (.buf.validate.predefined) = { ... }
* @param value The email to set.
* @return This builder for chaining.
*/
public Builder setEmail(boolean value) {
wellKnownCase_ = 12;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `email` specifies that the field value must be a valid email address
* (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1).
* If the field value isn't a valid email address, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid email address
* string value = 1 [(buf.validate.field).string.email = true];
* }
* ```
*
*
* bool email = 12 [json_name = "email", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearEmail() {
if (wellKnownCase_ == 12) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `hostname` specifies that the field value must be a valid
* hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support
* internationalized domain names (IDNs). If the field value isn't a
* valid hostname, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid hostname
* string value = 1 [(buf.validate.field).string.hostname = true];
* }
* ```
*
*
* bool hostname = 13 [json_name = "hostname", (.buf.validate.predefined) = { ... }
* @return Whether the hostname field is set.
*/
public boolean hasHostname() {
return wellKnownCase_ == 13;
}
/**
*
* `hostname` specifies that the field value must be a valid
* hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support
* internationalized domain names (IDNs). If the field value isn't a
* valid hostname, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid hostname
* string value = 1 [(buf.validate.field).string.hostname = true];
* }
* ```
*
*
* bool hostname = 13 [json_name = "hostname", (.buf.validate.predefined) = { ... }
* @return The hostname.
*/
public boolean getHostname() {
if (wellKnownCase_ == 13) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `hostname` specifies that the field value must be a valid
* hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support
* internationalized domain names (IDNs). If the field value isn't a
* valid hostname, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid hostname
* string value = 1 [(buf.validate.field).string.hostname = true];
* }
* ```
*
*
* bool hostname = 13 [json_name = "hostname", (.buf.validate.predefined) = { ... }
* @param value The hostname to set.
* @return This builder for chaining.
*/
public Builder setHostname(boolean value) {
wellKnownCase_ = 13;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `hostname` specifies that the field value must be a valid
* hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support
* internationalized domain names (IDNs). If the field value isn't a
* valid hostname, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid hostname
* string value = 1 [(buf.validate.field).string.hostname = true];
* }
* ```
*
*
* bool hostname = 13 [json_name = "hostname", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearHostname() {
if (wellKnownCase_ == 13) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `ip` specifies that the field value must be a valid IP
* (v4 or v6) address, without surrounding square brackets for IPv6 addresses.
* If the field value isn't a valid IP address, an error message will be
* generated.
*
* ```proto
* message MyString {
* // value must be a valid IP address
* string value = 1 [(buf.validate.field).string.ip = true];
* }
* ```
*
*
* bool ip = 14 [json_name = "ip", (.buf.validate.predefined) = { ... }
* @return Whether the ip field is set.
*/
public boolean hasIp() {
return wellKnownCase_ == 14;
}
/**
*
* `ip` specifies that the field value must be a valid IP
* (v4 or v6) address, without surrounding square brackets for IPv6 addresses.
* If the field value isn't a valid IP address, an error message will be
* generated.
*
* ```proto
* message MyString {
* // value must be a valid IP address
* string value = 1 [(buf.validate.field).string.ip = true];
* }
* ```
*
*
* bool ip = 14 [json_name = "ip", (.buf.validate.predefined) = { ... }
* @return The ip.
*/
public boolean getIp() {
if (wellKnownCase_ == 14) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `ip` specifies that the field value must be a valid IP
* (v4 or v6) address, without surrounding square brackets for IPv6 addresses.
* If the field value isn't a valid IP address, an error message will be
* generated.
*
* ```proto
* message MyString {
* // value must be a valid IP address
* string value = 1 [(buf.validate.field).string.ip = true];
* }
* ```
*
*
* bool ip = 14 [json_name = "ip", (.buf.validate.predefined) = { ... }
* @param value The ip to set.
* @return This builder for chaining.
*/
public Builder setIp(boolean value) {
wellKnownCase_ = 14;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `ip` specifies that the field value must be a valid IP
* (v4 or v6) address, without surrounding square brackets for IPv6 addresses.
* If the field value isn't a valid IP address, an error message will be
* generated.
*
* ```proto
* message MyString {
* // value must be a valid IP address
* string value = 1 [(buf.validate.field).string.ip = true];
* }
* ```
*
*
* bool ip = 14 [json_name = "ip", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearIp() {
if (wellKnownCase_ == 14) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `ipv4` specifies that the field value must be a valid IPv4
* address. If the field value isn't a valid IPv4 address, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv4 address
* string value = 1 [(buf.validate.field).string.ipv4 = true];
* }
* ```
*
*
* bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.predefined) = { ... }
* @return Whether the ipv4 field is set.
*/
public boolean hasIpv4() {
return wellKnownCase_ == 15;
}
/**
*
* `ipv4` specifies that the field value must be a valid IPv4
* address. If the field value isn't a valid IPv4 address, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv4 address
* string value = 1 [(buf.validate.field).string.ipv4 = true];
* }
* ```
*
*
* bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.predefined) = { ... }
* @return The ipv4.
*/
public boolean getIpv4() {
if (wellKnownCase_ == 15) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `ipv4` specifies that the field value must be a valid IPv4
* address. If the field value isn't a valid IPv4 address, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv4 address
* string value = 1 [(buf.validate.field).string.ipv4 = true];
* }
* ```
*
*
* bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.predefined) = { ... }
* @param value The ipv4 to set.
* @return This builder for chaining.
*/
public Builder setIpv4(boolean value) {
wellKnownCase_ = 15;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `ipv4` specifies that the field value must be a valid IPv4
* address. If the field value isn't a valid IPv4 address, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv4 address
* string value = 1 [(buf.validate.field).string.ipv4 = true];
* }
* ```
*
*
* bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearIpv4() {
if (wellKnownCase_ == 15) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `ipv6` specifies that the field value must be a valid
* IPv6 address, without surrounding square brackets. If the field value is
* not a valid IPv6 address, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv6 address
* string value = 1 [(buf.validate.field).string.ipv6 = true];
* }
* ```
*
*
* bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.predefined) = { ... }
* @return Whether the ipv6 field is set.
*/
public boolean hasIpv6() {
return wellKnownCase_ == 16;
}
/**
*
* `ipv6` specifies that the field value must be a valid
* IPv6 address, without surrounding square brackets. If the field value is
* not a valid IPv6 address, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv6 address
* string value = 1 [(buf.validate.field).string.ipv6 = true];
* }
* ```
*
*
* bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.predefined) = { ... }
* @return The ipv6.
*/
public boolean getIpv6() {
if (wellKnownCase_ == 16) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `ipv6` specifies that the field value must be a valid
* IPv6 address, without surrounding square brackets. If the field value is
* not a valid IPv6 address, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv6 address
* string value = 1 [(buf.validate.field).string.ipv6 = true];
* }
* ```
*
*
* bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.predefined) = { ... }
* @param value The ipv6 to set.
* @return This builder for chaining.
*/
public Builder setIpv6(boolean value) {
wellKnownCase_ = 16;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `ipv6` specifies that the field value must be a valid
* IPv6 address, without surrounding square brackets. If the field value is
* not a valid IPv6 address, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv6 address
* string value = 1 [(buf.validate.field).string.ipv6 = true];
* }
* ```
*
*
* bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearIpv6() {
if (wellKnownCase_ == 16) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `uri` specifies that the field value must be a valid,
* absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid,
* absolute URI, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid URI
* string value = 1 [(buf.validate.field).string.uri = true];
* }
* ```
*
*
* bool uri = 17 [json_name = "uri", (.buf.validate.predefined) = { ... }
* @return Whether the uri field is set.
*/
public boolean hasUri() {
return wellKnownCase_ == 17;
}
/**
*
* `uri` specifies that the field value must be a valid,
* absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid,
* absolute URI, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid URI
* string value = 1 [(buf.validate.field).string.uri = true];
* }
* ```
*
*
* bool uri = 17 [json_name = "uri", (.buf.validate.predefined) = { ... }
* @return The uri.
*/
public boolean getUri() {
if (wellKnownCase_ == 17) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `uri` specifies that the field value must be a valid,
* absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid,
* absolute URI, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid URI
* string value = 1 [(buf.validate.field).string.uri = true];
* }
* ```
*
*
* bool uri = 17 [json_name = "uri", (.buf.validate.predefined) = { ... }
* @param value The uri to set.
* @return This builder for chaining.
*/
public Builder setUri(boolean value) {
wellKnownCase_ = 17;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `uri` specifies that the field value must be a valid,
* absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid,
* absolute URI, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid URI
* string value = 1 [(buf.validate.field).string.uri = true];
* }
* ```
*
*
* bool uri = 17 [json_name = "uri", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearUri() {
if (wellKnownCase_ == 17) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `uri_ref` specifies that the field value must be a valid URI
* as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the
* field value isn't a valid URI, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid URI
* string value = 1 [(buf.validate.field).string.uri_ref = true];
* }
* ```
*
*
* bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.predefined) = { ... }
* @return Whether the uriRef field is set.
*/
public boolean hasUriRef() {
return wellKnownCase_ == 18;
}
/**
*
* `uri_ref` specifies that the field value must be a valid URI
* as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the
* field value isn't a valid URI, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid URI
* string value = 1 [(buf.validate.field).string.uri_ref = true];
* }
* ```
*
*
* bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.predefined) = { ... }
* @return The uriRef.
*/
public boolean getUriRef() {
if (wellKnownCase_ == 18) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `uri_ref` specifies that the field value must be a valid URI
* as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the
* field value isn't a valid URI, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid URI
* string value = 1 [(buf.validate.field).string.uri_ref = true];
* }
* ```
*
*
* bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.predefined) = { ... }
* @param value The uriRef to set.
* @return This builder for chaining.
*/
public Builder setUriRef(boolean value) {
wellKnownCase_ = 18;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `uri_ref` specifies that the field value must be a valid URI
* as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the
* field value isn't a valid URI, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid URI
* string value = 1 [(buf.validate.field).string.uri_ref = true];
* }
* ```
*
*
* bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearUriRef() {
if (wellKnownCase_ == 18) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `address` specifies that the field value must be either a valid hostname
* as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5)
* (which doesn't support internationalized domain names or IDNs) or a valid
* IP (v4 or v6). If the field value isn't a valid hostname or IP, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid hostname, or ip address
* string value = 1 [(buf.validate.field).string.address = true];
* }
* ```
*
*
* bool address = 21 [json_name = "address", (.buf.validate.predefined) = { ... }
* @return Whether the address field is set.
*/
public boolean hasAddress() {
return wellKnownCase_ == 21;
}
/**
*
* `address` specifies that the field value must be either a valid hostname
* as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5)
* (which doesn't support internationalized domain names or IDNs) or a valid
* IP (v4 or v6). If the field value isn't a valid hostname or IP, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid hostname, or ip address
* string value = 1 [(buf.validate.field).string.address = true];
* }
* ```
*
*
* bool address = 21 [json_name = "address", (.buf.validate.predefined) = { ... }
* @return The address.
*/
public boolean getAddress() {
if (wellKnownCase_ == 21) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `address` specifies that the field value must be either a valid hostname
* as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5)
* (which doesn't support internationalized domain names or IDNs) or a valid
* IP (v4 or v6). If the field value isn't a valid hostname or IP, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid hostname, or ip address
* string value = 1 [(buf.validate.field).string.address = true];
* }
* ```
*
*
* bool address = 21 [json_name = "address", (.buf.validate.predefined) = { ... }
* @param value The address to set.
* @return This builder for chaining.
*/
public Builder setAddress(boolean value) {
wellKnownCase_ = 21;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `address` specifies that the field value must be either a valid hostname
* as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5)
* (which doesn't support internationalized domain names or IDNs) or a valid
* IP (v4 or v6). If the field value isn't a valid hostname or IP, an error
* message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid hostname, or ip address
* string value = 1 [(buf.validate.field).string.address = true];
* }
* ```
*
*
* bool address = 21 [json_name = "address", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearAddress() {
if (wellKnownCase_ == 21) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `uuid` specifies that the field value must be a valid UUID as defined by
* [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the
* field value isn't a valid UUID, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid UUID
* string value = 1 [(buf.validate.field).string.uuid = true];
* }
* ```
*
*
* bool uuid = 22 [json_name = "uuid", (.buf.validate.predefined) = { ... }
* @return Whether the uuid field is set.
*/
public boolean hasUuid() {
return wellKnownCase_ == 22;
}
/**
*
* `uuid` specifies that the field value must be a valid UUID as defined by
* [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the
* field value isn't a valid UUID, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid UUID
* string value = 1 [(buf.validate.field).string.uuid = true];
* }
* ```
*
*
* bool uuid = 22 [json_name = "uuid", (.buf.validate.predefined) = { ... }
* @return The uuid.
*/
public boolean getUuid() {
if (wellKnownCase_ == 22) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `uuid` specifies that the field value must be a valid UUID as defined by
* [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the
* field value isn't a valid UUID, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid UUID
* string value = 1 [(buf.validate.field).string.uuid = true];
* }
* ```
*
*
* bool uuid = 22 [json_name = "uuid", (.buf.validate.predefined) = { ... }
* @param value The uuid to set.
* @return This builder for chaining.
*/
public Builder setUuid(boolean value) {
wellKnownCase_ = 22;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `uuid` specifies that the field value must be a valid UUID as defined by
* [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the
* field value isn't a valid UUID, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid UUID
* string value = 1 [(buf.validate.field).string.uuid = true];
* }
* ```
*
*
* bool uuid = 22 [json_name = "uuid", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearUuid() {
if (wellKnownCase_ == 22) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as
* defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2) with all dashes
* omitted. If the field value isn't a valid UUID without dashes, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value must be a valid trimmed UUID
* string value = 1 [(buf.validate.field).string.tuuid = true];
* }
* ```
*
*
* bool tuuid = 33 [json_name = "tuuid", (.buf.validate.predefined) = { ... }
* @return Whether the tuuid field is set.
*/
public boolean hasTuuid() {
return wellKnownCase_ == 33;
}
/**
*
* `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as
* defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2) with all dashes
* omitted. If the field value isn't a valid UUID without dashes, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value must be a valid trimmed UUID
* string value = 1 [(buf.validate.field).string.tuuid = true];
* }
* ```
*
*
* bool tuuid = 33 [json_name = "tuuid", (.buf.validate.predefined) = { ... }
* @return The tuuid.
*/
public boolean getTuuid() {
if (wellKnownCase_ == 33) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as
* defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2) with all dashes
* omitted. If the field value isn't a valid UUID without dashes, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value must be a valid trimmed UUID
* string value = 1 [(buf.validate.field).string.tuuid = true];
* }
* ```
*
*
* bool tuuid = 33 [json_name = "tuuid", (.buf.validate.predefined) = { ... }
* @param value The tuuid to set.
* @return This builder for chaining.
*/
public Builder setTuuid(boolean value) {
wellKnownCase_ = 33;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as
* defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2) with all dashes
* omitted. If the field value isn't a valid UUID without dashes, an error message
* will be generated.
*
* ```proto
* message MyString {
* // value must be a valid trimmed UUID
* string value = 1 [(buf.validate.field).string.tuuid = true];
* }
* ```
*
*
* bool tuuid = 33 [json_name = "tuuid", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearTuuid() {
if (wellKnownCase_ == 33) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6)
* address with prefix length. If the field value isn't a valid IP with prefix
* length, an error message will be generated.
*
*
* ```proto
* message MyString {
* // value must be a valid IP with prefix length
* string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];
* }
* ```
*
*
* bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.predefined) = { ... }
* @return Whether the ipWithPrefixlen field is set.
*/
public boolean hasIpWithPrefixlen() {
return wellKnownCase_ == 26;
}
/**
*
* `ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6)
* address with prefix length. If the field value isn't a valid IP with prefix
* length, an error message will be generated.
*
*
* ```proto
* message MyString {
* // value must be a valid IP with prefix length
* string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];
* }
* ```
*
*
* bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.predefined) = { ... }
* @return The ipWithPrefixlen.
*/
public boolean getIpWithPrefixlen() {
if (wellKnownCase_ == 26) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6)
* address with prefix length. If the field value isn't a valid IP with prefix
* length, an error message will be generated.
*
*
* ```proto
* message MyString {
* // value must be a valid IP with prefix length
* string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];
* }
* ```
*
*
* bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.predefined) = { ... }
* @param value The ipWithPrefixlen to set.
* @return This builder for chaining.
*/
public Builder setIpWithPrefixlen(boolean value) {
wellKnownCase_ = 26;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6)
* address with prefix length. If the field value isn't a valid IP with prefix
* length, an error message will be generated.
*
*
* ```proto
* message MyString {
* // value must be a valid IP with prefix length
* string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];
* }
* ```
*
*
* bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearIpWithPrefixlen() {
if (wellKnownCase_ == 26) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `ipv4_with_prefixlen` specifies that the field value must be a valid
* IPv4 address with prefix.
* If the field value isn't a valid IPv4 address with prefix length,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv4 address with prefix length
* string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
* }
* ```
*
*
* bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.predefined) = { ... }
* @return Whether the ipv4WithPrefixlen field is set.
*/
public boolean hasIpv4WithPrefixlen() {
return wellKnownCase_ == 27;
}
/**
*
* `ipv4_with_prefixlen` specifies that the field value must be a valid
* IPv4 address with prefix.
* If the field value isn't a valid IPv4 address with prefix length,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv4 address with prefix length
* string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
* }
* ```
*
*
* bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.predefined) = { ... }
* @return The ipv4WithPrefixlen.
*/
public boolean getIpv4WithPrefixlen() {
if (wellKnownCase_ == 27) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `ipv4_with_prefixlen` specifies that the field value must be a valid
* IPv4 address with prefix.
* If the field value isn't a valid IPv4 address with prefix length,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv4 address with prefix length
* string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
* }
* ```
*
*
* bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.predefined) = { ... }
* @param value The ipv4WithPrefixlen to set.
* @return This builder for chaining.
*/
public Builder setIpv4WithPrefixlen(boolean value) {
wellKnownCase_ = 27;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `ipv4_with_prefixlen` specifies that the field value must be a valid
* IPv4 address with prefix.
* If the field value isn't a valid IPv4 address with prefix length,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv4 address with prefix length
* string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
* }
* ```
*
*
* bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearIpv4WithPrefixlen() {
if (wellKnownCase_ == 27) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `ipv6_with_prefixlen` specifies that the field value must be a valid
* IPv6 address with prefix length.
* If the field value is not a valid IPv6 address with prefix length,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv6 address prefix length
* string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];
* }
* ```
*
*
* bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.predefined) = { ... }
* @return Whether the ipv6WithPrefixlen field is set.
*/
public boolean hasIpv6WithPrefixlen() {
return wellKnownCase_ == 28;
}
/**
*
* `ipv6_with_prefixlen` specifies that the field value must be a valid
* IPv6 address with prefix length.
* If the field value is not a valid IPv6 address with prefix length,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv6 address prefix length
* string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];
* }
* ```
*
*
* bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.predefined) = { ... }
* @return The ipv6WithPrefixlen.
*/
public boolean getIpv6WithPrefixlen() {
if (wellKnownCase_ == 28) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `ipv6_with_prefixlen` specifies that the field value must be a valid
* IPv6 address with prefix length.
* If the field value is not a valid IPv6 address with prefix length,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv6 address prefix length
* string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];
* }
* ```
*
*
* bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.predefined) = { ... }
* @param value The ipv6WithPrefixlen to set.
* @return This builder for chaining.
*/
public Builder setIpv6WithPrefixlen(boolean value) {
wellKnownCase_ = 28;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `ipv6_with_prefixlen` specifies that the field value must be a valid
* IPv6 address with prefix length.
* If the field value is not a valid IPv6 address with prefix length,
* an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid IPv6 address prefix length
* string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];
* }
* ```
*
*
* bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearIpv6WithPrefixlen() {
if (wellKnownCase_ == 28) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix.
* If the field value isn't a valid IP prefix, an error message will be
* generated. The prefix must have all zeros for the masked bits of the prefix (e.g.,
* `127.0.0.0/16`, not `127.0.0.1/16`).
*
* ```proto
* message MyString {
* // value must be a valid IP prefix
* string value = 1 [(buf.validate.field).string.ip_prefix = true];
* }
* ```
*
*
* bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.predefined) = { ... }
* @return Whether the ipPrefix field is set.
*/
public boolean hasIpPrefix() {
return wellKnownCase_ == 29;
}
/**
*
* `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix.
* If the field value isn't a valid IP prefix, an error message will be
* generated. The prefix must have all zeros for the masked bits of the prefix (e.g.,
* `127.0.0.0/16`, not `127.0.0.1/16`).
*
* ```proto
* message MyString {
* // value must be a valid IP prefix
* string value = 1 [(buf.validate.field).string.ip_prefix = true];
* }
* ```
*
*
* bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.predefined) = { ... }
* @return The ipPrefix.
*/
public boolean getIpPrefix() {
if (wellKnownCase_ == 29) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix.
* If the field value isn't a valid IP prefix, an error message will be
* generated. The prefix must have all zeros for the masked bits of the prefix (e.g.,
* `127.0.0.0/16`, not `127.0.0.1/16`).
*
* ```proto
* message MyString {
* // value must be a valid IP prefix
* string value = 1 [(buf.validate.field).string.ip_prefix = true];
* }
* ```
*
*
* bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.predefined) = { ... }
* @param value The ipPrefix to set.
* @return This builder for chaining.
*/
public Builder setIpPrefix(boolean value) {
wellKnownCase_ = 29;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix.
* If the field value isn't a valid IP prefix, an error message will be
* generated. The prefix must have all zeros for the masked bits of the prefix (e.g.,
* `127.0.0.0/16`, not `127.0.0.1/16`).
*
* ```proto
* message MyString {
* // value must be a valid IP prefix
* string value = 1 [(buf.validate.field).string.ip_prefix = true];
* }
* ```
*
*
* bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearIpPrefix() {
if (wellKnownCase_ == 29) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `ipv4_prefix` specifies that the field value must be a valid IPv4
* prefix. If the field value isn't a valid IPv4 prefix, an error message
* will be generated. The prefix must have all zeros for the masked bits of
* the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`).
*
* ```proto
* message MyString {
* // value must be a valid IPv4 prefix
* string value = 1 [(buf.validate.field).string.ipv4_prefix = true];
* }
* ```
*
*
* bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.predefined) = { ... }
* @return Whether the ipv4Prefix field is set.
*/
public boolean hasIpv4Prefix() {
return wellKnownCase_ == 30;
}
/**
*
* `ipv4_prefix` specifies that the field value must be a valid IPv4
* prefix. If the field value isn't a valid IPv4 prefix, an error message
* will be generated. The prefix must have all zeros for the masked bits of
* the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`).
*
* ```proto
* message MyString {
* // value must be a valid IPv4 prefix
* string value = 1 [(buf.validate.field).string.ipv4_prefix = true];
* }
* ```
*
*
* bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.predefined) = { ... }
* @return The ipv4Prefix.
*/
public boolean getIpv4Prefix() {
if (wellKnownCase_ == 30) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `ipv4_prefix` specifies that the field value must be a valid IPv4
* prefix. If the field value isn't a valid IPv4 prefix, an error message
* will be generated. The prefix must have all zeros for the masked bits of
* the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`).
*
* ```proto
* message MyString {
* // value must be a valid IPv4 prefix
* string value = 1 [(buf.validate.field).string.ipv4_prefix = true];
* }
* ```
*
*
* bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.predefined) = { ... }
* @param value The ipv4Prefix to set.
* @return This builder for chaining.
*/
public Builder setIpv4Prefix(boolean value) {
wellKnownCase_ = 30;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `ipv4_prefix` specifies that the field value must be a valid IPv4
* prefix. If the field value isn't a valid IPv4 prefix, an error message
* will be generated. The prefix must have all zeros for the masked bits of
* the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`).
*
* ```proto
* message MyString {
* // value must be a valid IPv4 prefix
* string value = 1 [(buf.validate.field).string.ipv4_prefix = true];
* }
* ```
*
*
* bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearIpv4Prefix() {
if (wellKnownCase_ == 30) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix.
* If the field value is not a valid IPv6 prefix, an error message will be
* generated. The prefix must have all zeros for the masked bits of the prefix
* (e.g., `2001:db8::/48`, not `2001:db8::1/48`).
*
* ```proto
* message MyString {
* // value must be a valid IPv6 prefix
* string value = 1 [(buf.validate.field).string.ipv6_prefix = true];
* }
* ```
*
*
* bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.predefined) = { ... }
* @return Whether the ipv6Prefix field is set.
*/
public boolean hasIpv6Prefix() {
return wellKnownCase_ == 31;
}
/**
*
* `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix.
* If the field value is not a valid IPv6 prefix, an error message will be
* generated. The prefix must have all zeros for the masked bits of the prefix
* (e.g., `2001:db8::/48`, not `2001:db8::1/48`).
*
* ```proto
* message MyString {
* // value must be a valid IPv6 prefix
* string value = 1 [(buf.validate.field).string.ipv6_prefix = true];
* }
* ```
*
*
* bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.predefined) = { ... }
* @return The ipv6Prefix.
*/
public boolean getIpv6Prefix() {
if (wellKnownCase_ == 31) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix.
* If the field value is not a valid IPv6 prefix, an error message will be
* generated. The prefix must have all zeros for the masked bits of the prefix
* (e.g., `2001:db8::/48`, not `2001:db8::1/48`).
*
* ```proto
* message MyString {
* // value must be a valid IPv6 prefix
* string value = 1 [(buf.validate.field).string.ipv6_prefix = true];
* }
* ```
*
*
* bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.predefined) = { ... }
* @param value The ipv6Prefix to set.
* @return This builder for chaining.
*/
public Builder setIpv6Prefix(boolean value) {
wellKnownCase_ = 31;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix.
* If the field value is not a valid IPv6 prefix, an error message will be
* generated. The prefix must have all zeros for the masked bits of the prefix
* (e.g., `2001:db8::/48`, not `2001:db8::1/48`).
*
* ```proto
* message MyString {
* // value must be a valid IPv6 prefix
* string value = 1 [(buf.validate.field).string.ipv6_prefix = true];
* }
* ```
*
*
* bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearIpv6Prefix() {
if (wellKnownCase_ == 31) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `host_and_port` specifies the field value must be a valid host and port
* pair. The host must be a valid hostname or IP address while the port
* must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
* with square brackets (e.g., `[::1]:1234`).
*
*
* bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.predefined) = { ... }
* @return Whether the hostAndPort field is set.
*/
public boolean hasHostAndPort() {
return wellKnownCase_ == 32;
}
/**
*
* `host_and_port` specifies the field value must be a valid host and port
* pair. The host must be a valid hostname or IP address while the port
* must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
* with square brackets (e.g., `[::1]:1234`).
*
*
* bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.predefined) = { ... }
* @return The hostAndPort.
*/
public boolean getHostAndPort() {
if (wellKnownCase_ == 32) {
return (java.lang.Boolean) wellKnown_;
}
return false;
}
/**
*
* `host_and_port` specifies the field value must be a valid host and port
* pair. The host must be a valid hostname or IP address while the port
* must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
* with square brackets (e.g., `[::1]:1234`).
*
*
* bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.predefined) = { ... }
* @param value The hostAndPort to set.
* @return This builder for chaining.
*/
public Builder setHostAndPort(boolean value) {
wellKnownCase_ = 32;
wellKnown_ = value;
onChanged();
return this;
}
/**
*
* `host_and_port` specifies the field value must be a valid host and port
* pair. The host must be a valid hostname or IP address while the port
* must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
* with square brackets (e.g., `[::1]:1234`).
*
*
* bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearHostAndPort() {
if (wellKnownCase_ == 32) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
/**
*
* `well_known_regex` specifies a common well-known pattern
* defined as a regex. If the field value doesn't match the well-known
* regex, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid HTTP header value
* string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
* }
* ```
*
* #### KnownRegex
*
* `well_known_regex` contains some well-known patterns.
*
* | Name | Number | Description |
* |-------------------------------|--------|-------------------------------------------|
* | KNOWN_REGEX_UNSPECIFIED | 0 | |
* | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) |
* | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |
*
*
* .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.predefined) = { ... }
* @return Whether the wellKnownRegex field is set.
*/
@java.lang.Override
public boolean hasWellKnownRegex() {
return wellKnownCase_ == 24;
}
/**
*
* `well_known_regex` specifies a common well-known pattern
* defined as a regex. If the field value doesn't match the well-known
* regex, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid HTTP header value
* string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
* }
* ```
*
* #### KnownRegex
*
* `well_known_regex` contains some well-known patterns.
*
* | Name | Number | Description |
* |-------------------------------|--------|-------------------------------------------|
* | KNOWN_REGEX_UNSPECIFIED | 0 | |
* | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) |
* | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |
*
*
* .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.predefined) = { ... }
* @return The wellKnownRegex.
*/
@java.lang.Override
public build.buf.validate.KnownRegex getWellKnownRegex() {
if (wellKnownCase_ == 24) {
build.buf.validate.KnownRegex result = build.buf.validate.KnownRegex.forNumber(
(java.lang.Integer) wellKnown_);
return result == null ? build.buf.validate.KnownRegex.KNOWN_REGEX_UNSPECIFIED : result;
}
return build.buf.validate.KnownRegex.KNOWN_REGEX_UNSPECIFIED;
}
/**
*
* `well_known_regex` specifies a common well-known pattern
* defined as a regex. If the field value doesn't match the well-known
* regex, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid HTTP header value
* string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
* }
* ```
*
* #### KnownRegex
*
* `well_known_regex` contains some well-known patterns.
*
* | Name | Number | Description |
* |-------------------------------|--------|-------------------------------------------|
* | KNOWN_REGEX_UNSPECIFIED | 0 | |
* | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) |
* | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |
*
*
* .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.predefined) = { ... }
* @param value The wellKnownRegex to set.
* @return This builder for chaining.
*/
public Builder setWellKnownRegex(build.buf.validate.KnownRegex value) {
if (value == null) {
throw new NullPointerException();
}
wellKnownCase_ = 24;
wellKnown_ = value.getNumber();
onChanged();
return this;
}
/**
*
* `well_known_regex` specifies a common well-known pattern
* defined as a regex. If the field value doesn't match the well-known
* regex, an error message will be generated.
*
* ```proto
* message MyString {
* // value must be a valid HTTP header value
* string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
* }
* ```
*
* #### KnownRegex
*
* `well_known_regex` contains some well-known patterns.
*
* | Name | Number | Description |
* |-------------------------------|--------|-------------------------------------------|
* | KNOWN_REGEX_UNSPECIFIED | 0 | |
* | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) |
* | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |
*
*
* .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearWellKnownRegex() {
if (wellKnownCase_ == 24) {
wellKnownCase_ = 0;
wellKnown_ = null;
onChanged();
}
return this;
}
private boolean strict_ ;
/**
*
* This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to
* enable strict header validation. By default, this is true, and HTTP header
* validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser
* validations that only disallow `\r\n\0` characters, which can be used to
* bypass header matching rules.
*
* ```proto
* message MyString {
* // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.
* string value = 1 [(buf.validate.field).string.strict = false];
* }
* ```
*
*
* optional bool strict = 25 [json_name = "strict"];
* @return Whether the strict field is set.
*/
@java.lang.Override
public boolean hasStrict() {
return ((bitField1_ & 0x00000001) != 0);
}
/**
*
* This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to
* enable strict header validation. By default, this is true, and HTTP header
* validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser
* validations that only disallow `\r\n\0` characters, which can be used to
* bypass header matching rules.
*
* ```proto
* message MyString {
* // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.
* string value = 1 [(buf.validate.field).string.strict = false];
* }
* ```
*
*
* optional bool strict = 25 [json_name = "strict"];
* @return The strict.
*/
@java.lang.Override
public boolean getStrict() {
return strict_;
}
/**
*
* This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to
* enable strict header validation. By default, this is true, and HTTP header
* validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser
* validations that only disallow `\r\n\0` characters, which can be used to
* bypass header matching rules.
*
* ```proto
* message MyString {
* // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.
* string value = 1 [(buf.validate.field).string.strict = false];
* }
* ```
*
*
* optional bool strict = 25 [json_name = "strict"];
* @param value The strict to set.
* @return This builder for chaining.
*/
public Builder setStrict(boolean value) {
strict_ = value;
bitField1_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to
* enable strict header validation. By default, this is true, and HTTP header
* validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser
* validations that only disallow `\r\n\0` characters, which can be used to
* bypass header matching rules.
*
* ```proto
* message MyString {
* // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.
* string value = 1 [(buf.validate.field).string.strict = false];
* }
* ```
*
*
* optional bool strict = 25 [json_name = "strict"];
* @return This builder for chaining.
*/
public Builder clearStrict() {
bitField1_ = (bitField1_ & ~0x00000001);
strict_ = false;
onChanged();
return this;
}
private com.google.protobuf.LazyStringArrayList example_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureExampleIsMutable() {
if (!example_.isModifiable()) {
example_ = new com.google.protobuf.LazyStringArrayList(example_);
}
bitField1_ |= 0x00000002;
}
/**
*
* `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 MyString {
* string value = 1 [
* (buf.validate.field).string.example = 1,
* (buf.validate.field).string.example = 2
* ];
* }
* ```
*
*
* repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... }
* @return A list containing the example.
*/
public com.google.protobuf.ProtocolStringList
getExampleList() {
example_.makeImmutable();
return example_;
}
/**
*
* `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 MyString {
* string value = 1 [
* (buf.validate.field).string.example = 1,
* (buf.validate.field).string.example = 2
* ];
* }
* ```
*
*
* repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... }
* @return The count of example.
*/
public int getExampleCount() {
return example_.size();
}
/**
*
* `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 MyString {
* string value = 1 [
* (buf.validate.field).string.example = 1,
* (buf.validate.field).string.example = 2
* ];
* }
* ```
*
*
* repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... }
* @param index The index of the element to return.
* @return The example at the given index.
*/
public java.lang.String getExample(int index) {
return example_.get(index);
}
/**
*
* `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 MyString {
* string value = 1 [
* (buf.validate.field).string.example = 1,
* (buf.validate.field).string.example = 2
* ];
* }
* ```
*
*
* repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... }
* @param index The index of the value to return.
* @return The bytes of the example at the given index.
*/
public com.google.protobuf.ByteString
getExampleBytes(int index) {
return example_.getByteString(index);
}
/**
*
* `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 MyString {
* string value = 1 [
* (buf.validate.field).string.example = 1,
* (buf.validate.field).string.example = 2
* ];
* }
* ```
*
*
* repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... }
* @param index The index to set the value at.
* @param value The example to set.
* @return This builder for chaining.
*/
public Builder setExample(
int index, java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensureExampleIsMutable();
example_.set(index, value);
bitField1_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* `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 MyString {
* string value = 1 [
* (buf.validate.field).string.example = 1,
* (buf.validate.field).string.example = 2
* ];
* }
* ```
*
*
* repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... }
* @param value The example to add.
* @return This builder for chaining.
*/
public Builder addExample(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensureExampleIsMutable();
example_.add(value);
bitField1_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* `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 MyString {
* string value = 1 [
* (buf.validate.field).string.example = 1,
* (buf.validate.field).string.example = 2
* ];
* }
* ```
*
*
* repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... }
* @param values The example to add.
* @return This builder for chaining.
*/
public Builder addAllExample(
java.lang.Iterable values) {
ensureExampleIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, example_);
bitField1_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* `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 MyString {
* string value = 1 [
* (buf.validate.field).string.example = 1,
* (buf.validate.field).string.example = 2
* ];
* }
* ```
*
*
* repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... }
* @return This builder for chaining.
*/
public Builder clearExample() {
example_ =
com.google.protobuf.LazyStringArrayList.emptyList();
bitField1_ = (bitField1_ & ~0x00000002);;
onChanged();
return this;
}
/**
*
* `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 MyString {
* string value = 1 [
* (buf.validate.field).string.example = 1,
* (buf.validate.field).string.example = 2
* ];
* }
* ```
*
*
* repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... }
* @param value The bytes of the example to add.
* @return This builder for chaining.
*/
public Builder addExampleBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
ensureExampleIsMutable();
example_.add(value);
bitField1_ |= 0x00000002;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:buf.validate.StringRules)
}
// @@protoc_insertion_point(class_scope:buf.validate.StringRules)
private static final build.buf.validate.StringRules DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new build.buf.validate.StringRules();
}
public static build.buf.validate.StringRules getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public StringRules parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public build.buf.validate.StringRules getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}