build.buf.validate.KnownRegex 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
The newest version!
// 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;
/**
*
* WellKnownRegex contain some well-known patterns.
*
*
* Protobuf enum {@code buf.validate.KnownRegex}
*/
public enum KnownRegex
implements com.google.protobuf.ProtocolMessageEnum {
/**
* KNOWN_REGEX_UNSPECIFIED = 0;
*/
KNOWN_REGEX_UNSPECIFIED(0),
/**
*
* HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2).
*
*
* KNOWN_REGEX_HTTP_HEADER_NAME = 1;
*/
KNOWN_REGEX_HTTP_HEADER_NAME(1),
/**
*
* HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4).
*
*
* KNOWN_REGEX_HTTP_HEADER_VALUE = 2;
*/
KNOWN_REGEX_HTTP_HEADER_VALUE(2),
UNRECOGNIZED(-1),
;
static {
com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
/* major= */ 4,
/* minor= */ 28,
/* patch= */ 1,
/* suffix= */ "",
KnownRegex.class.getName());
}
/**
* KNOWN_REGEX_UNSPECIFIED = 0;
*/
public static final int KNOWN_REGEX_UNSPECIFIED_VALUE = 0;
/**
*
* HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2).
*
*
* KNOWN_REGEX_HTTP_HEADER_NAME = 1;
*/
public static final int KNOWN_REGEX_HTTP_HEADER_NAME_VALUE = 1;
/**
*
* HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4).
*
*
* KNOWN_REGEX_HTTP_HEADER_VALUE = 2;
*/
public static final int KNOWN_REGEX_HTTP_HEADER_VALUE_VALUE = 2;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static KnownRegex valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static KnownRegex forNumber(int value) {
switch (value) {
case 0: return KNOWN_REGEX_UNSPECIFIED;
case 1: return KNOWN_REGEX_HTTP_HEADER_NAME;
case 2: return KNOWN_REGEX_HTTP_HEADER_VALUE;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
KnownRegex> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public KnownRegex findValueByNumber(int number) {
return KnownRegex.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return build.buf.validate.ValidateProto.getDescriptor().getEnumTypes().get(1);
}
private static final KnownRegex[] VALUES = values();
public static KnownRegex valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private KnownRegex(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:buf.validate.KnownRegex)
}