public final class EnumRules extends com.google.protobuf.GeneratedMessageV3 implements EnumRulesOrBuilder
EnumRules describe the constraints applied to `enum` values.Protobuf type
buf.validate.EnumRules| Modifier and Type | Class and Description |
|---|---|
static class |
EnumRules.Builder
EnumRules describe the constraints applied to `enum` values.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
CONST_FIELD_NUMBER |
static int |
DEFINED_ONLY_FIELD_NUMBER |
static int |
IN_FIELD_NUMBER |
static int |
NOT_IN_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
int |
getConst()
`const` requires the field value to exactly match the specified enum value.
|
static EnumRules |
getDefaultInstance() |
EnumRules |
getDefaultInstanceForType() |
boolean |
getDefinedOnly()
`defined_only` requires the field value to be one of the defined values for
this enum, failing on any undefined value.
|
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
int |
getIn(int index)
`in` requires the field value to be equal to one of the
specified enum values.
|
int |
getInCount()
`in` requires the field value to be equal to one of the
specified enum values.
|
List<Integer> |
getInList()
`in` requires the field value to be equal to one of the
specified enum values.
|
int |
getNotIn(int index)
`not_in` requires the field value to be not equal to any of the
specified enum values.
|
int |
getNotInCount()
`not_in` requires the field value to be not equal to any of the
specified enum values.
|
List<Integer> |
getNotInList()
`not_in` requires the field value to be not equal to any of the
specified enum values.
|
com.google.protobuf.Parser<EnumRules> |
getParserForType() |
boolean |
hasConst()
`const` requires the field value to exactly match the specified enum value.
|
boolean |
hasDefinedOnly()
`defined_only` requires the field value to be one of the defined values for
this enum, failing on any undefined value.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
static EnumRules.Builder |
newBuilder() |
static EnumRules.Builder |
newBuilder(EnumRules prototype) |
EnumRules.Builder |
newBuilderForType() |
protected EnumRules.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static EnumRules |
parseDelimitedFrom(InputStream input) |
static EnumRules |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static EnumRules |
parseFrom(byte[] data) |
static EnumRules |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static EnumRules |
parseFrom(ByteBuffer data) |
static EnumRules |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static EnumRules |
parseFrom(com.google.protobuf.ByteString data) |
static EnumRules |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static EnumRules |
parseFrom(com.google.protobuf.CodedInputStream input) |
static EnumRules |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static EnumRules |
parseFrom(InputStream input) |
static EnumRules |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<EnumRules> |
parser() |
EnumRules.Builder |
toBuilder() |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getSerializedSize, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isInitialized, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag, writeToequals, findInitializationErrors, getInitializationErrorString, hashBoolean, hashCode, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int CONST_FIELD_NUMBER
public static final int DEFINED_ONLY_FIELD_NUMBER
public static final int IN_FIELD_NUMBER
public static final int NOT_IN_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public boolean hasConst()
`const` requires the field value to exactly match the specified enum value.
If the field value doesn't match, an error message is generated.
```proto
enum MyEnum {
MY_ENUM_UNSPECIFIED = 0;
MY_ENUM_VALUE1 = 1;
MY_ENUM_VALUE2 = 2;
}
message MyMessage {
// The field `value` must be exactly MY_ENUM_VALUE1.
MyEnum value = 1 [(buf.validate.field).enum.const = 1];
}
```
optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... }hasConst in interface EnumRulesOrBuilderpublic int getConst()
`const` requires the field value to exactly match the specified enum value.
If the field value doesn't match, an error message is generated.
```proto
enum MyEnum {
MY_ENUM_UNSPECIFIED = 0;
MY_ENUM_VALUE1 = 1;
MY_ENUM_VALUE2 = 2;
}
message MyMessage {
// The field `value` must be exactly MY_ENUM_VALUE1.
MyEnum value = 1 [(buf.validate.field).enum.const = 1];
}
```
optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... }getConst in interface EnumRulesOrBuilderpublic boolean hasDefinedOnly()
`defined_only` requires the field value to be one of the defined values for
this enum, failing on any undefined value.
```proto
enum MyEnum {
MY_ENUM_UNSPECIFIED = 0;
MY_ENUM_VALUE1 = 1;
MY_ENUM_VALUE2 = 2;
}
message MyMessage {
// The field `value` must be a defined value of MyEnum.
MyEnum value = 1 [(buf.validate.field).enum.defined_only = true];
}
```
optional bool defined_only = 2 [json_name = "definedOnly"];hasDefinedOnly in interface EnumRulesOrBuilderpublic boolean getDefinedOnly()
`defined_only` requires the field value to be one of the defined values for
this enum, failing on any undefined value.
```proto
enum MyEnum {
MY_ENUM_UNSPECIFIED = 0;
MY_ENUM_VALUE1 = 1;
MY_ENUM_VALUE2 = 2;
}
message MyMessage {
// The field `value` must be a defined value of MyEnum.
MyEnum value = 1 [(buf.validate.field).enum.defined_only = true];
}
```
optional bool defined_only = 2 [json_name = "definedOnly"];getDefinedOnly in interface EnumRulesOrBuilderpublic List<Integer> getInList()
`in` requires the field value to be equal to one of the
specified enum values. If the field value doesn't match any of the
specified values, an error message is generated.
```proto
enum MyEnum {
MY_ENUM_UNSPECIFIED = 0;
MY_ENUM_VALUE1 = 1;
MY_ENUM_VALUE2 = 2;
}
message MyMessage {
// The field `value` must be equal to one of the specified values.
MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}];
}
```
repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... }getInList in interface EnumRulesOrBuilderpublic int getInCount()
`in` requires the field value to be equal to one of the
specified enum values. If the field value doesn't match any of the
specified values, an error message is generated.
```proto
enum MyEnum {
MY_ENUM_UNSPECIFIED = 0;
MY_ENUM_VALUE1 = 1;
MY_ENUM_VALUE2 = 2;
}
message MyMessage {
// The field `value` must be equal to one of the specified values.
MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}];
}
```
repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... }getInCount in interface EnumRulesOrBuilderpublic int getIn(int index)
`in` requires the field value to be equal to one of the
specified enum values. If the field value doesn't match any of the
specified values, an error message is generated.
```proto
enum MyEnum {
MY_ENUM_UNSPECIFIED = 0;
MY_ENUM_VALUE1 = 1;
MY_ENUM_VALUE2 = 2;
}
message MyMessage {
// The field `value` must be equal to one of the specified values.
MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}];
}
```
repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... }getIn in interface EnumRulesOrBuilderindex - The index of the element to return.public List<Integer> getNotInList()
`not_in` requires the field value to be not equal to any of the
specified enum values. If the field value matches one of the specified
values, an error message is generated.
```proto
enum MyEnum {
MY_ENUM_UNSPECIFIED = 0;
MY_ENUM_VALUE1 = 1;
MY_ENUM_VALUE2 = 2;
}
message MyMessage {
// The field `value` must not be equal to any of the specified values.
MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}];
}
```
repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... }getNotInList in interface EnumRulesOrBuilderpublic int getNotInCount()
`not_in` requires the field value to be not equal to any of the
specified enum values. If the field value matches one of the specified
values, an error message is generated.
```proto
enum MyEnum {
MY_ENUM_UNSPECIFIED = 0;
MY_ENUM_VALUE1 = 1;
MY_ENUM_VALUE2 = 2;
}
message MyMessage {
// The field `value` must not be equal to any of the specified values.
MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}];
}
```
repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... }getNotInCount in interface EnumRulesOrBuilderpublic int getNotIn(int index)
`not_in` requires the field value to be not equal to any of the
specified enum values. If the field value matches one of the specified
values, an error message is generated.
```proto
enum MyEnum {
MY_ENUM_UNSPECIFIED = 0;
MY_ENUM_VALUE1 = 1;
MY_ENUM_VALUE2 = 2;
}
message MyMessage {
// The field `value` must not be equal to any of the specified values.
MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}];
}
```
repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... }getNotIn in interface EnumRulesOrBuilderindex - The index of the element to return.public static EnumRules parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static EnumRules parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static EnumRules parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static EnumRules parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static EnumRules parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static EnumRules parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static EnumRules parseFrom(InputStream input) throws IOException
IOExceptionpublic static EnumRules parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static EnumRules parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static EnumRules parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static EnumRules parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static EnumRules parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic EnumRules.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static EnumRules.Builder newBuilder()
public static EnumRules.Builder newBuilder(EnumRules prototype)
public EnumRules.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected EnumRules.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static EnumRules getDefaultInstance()
public static com.google.protobuf.Parser<EnumRules> parser()
public com.google.protobuf.Parser<EnumRules> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public EnumRules getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2023. All rights reserved.