public interface EnumRulesOrBuilder
extends com.google.protobuf.MessageOrBuilder
| Modifier and Type | Method and Description |
|---|---|
int |
getConst()
`const` requires the field value to exactly match the specified enum value.
|
boolean |
getDefinedOnly()
`defined_only` requires the field value to be one of the defined values for
this enum, failing on any undefined value.
|
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.
|
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.
|
findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneofboolean 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) = { ... }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) = { ... }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"];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"];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) = { ... }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) = { ... }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) = { ... }index - The index of the element to return.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) = { ... }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) = { ... }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) = { ... }index - The index of the element to return.Copyright © 2024. All rights reserved.