public static final class EnumRules.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<EnumRules.Builder> implements EnumRulesOrBuilder
EnumRules describe the constraints applied to `enum` values.Protobuf type
buf.validate.EnumRules| Modifier and Type | Method and Description |
|---|---|
EnumRules.Builder |
addAllIn(Iterable<? extends Integer> values)
`in` requires the field value to be equal to one of the
specified enum values.
|
EnumRules.Builder |
addAllNotIn(Iterable<? extends Integer> values)
`not_in` requires the field value to be not equal to any of the
specified enum values.
|
EnumRules.Builder |
addIn(int value)
`in` requires the field value to be equal to one of the
specified enum values.
|
EnumRules.Builder |
addNotIn(int value)
`not_in` requires the field value to be not equal to any of the
specified enum values.
|
EnumRules.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
EnumRules |
build() |
EnumRules |
buildPartial() |
EnumRules.Builder |
clear() |
EnumRules.Builder |
clearConst()
`const` requires the field value to exactly match the specified enum value.
|
EnumRules.Builder |
clearDefinedOnly()
`defined_only` requires the field value to be one of the defined values for
this enum, failing on any undefined value.
|
EnumRules.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
EnumRules.Builder |
clearIn()
`in` requires the field value to be equal to one of the
specified enum values.
|
EnumRules.Builder |
clearNotIn()
`not_in` requires the field value to be not equal to any of the
specified enum values.
|
EnumRules.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
EnumRules.Builder |
clone() |
int |
getConst()
`const` requires the field value to exactly match the specified enum value.
|
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() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
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.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
EnumRules.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
EnumRules.Builder |
setConst(int value)
`const` requires the field value to exactly match the specified enum value.
|
EnumRules.Builder |
setDefinedOnly(boolean value)
`defined_only` requires the field value to be one of the defined values for
this enum, failing on any undefined value.
|
EnumRules.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
EnumRules.Builder |
setIn(int index,
int value)
`in` requires the field value to be equal to one of the
specified enum values.
|
EnumRules.Builder |
setNotIn(int index,
int value)
`not_in` requires the field value to be not equal to any of the
specified enum values.
|
EnumRules.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
EnumRules.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, isInitialized, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<EnumRules.Builder>public EnumRules.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<EnumRules.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<EnumRules.Builder>public EnumRules getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic EnumRules build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic EnumRules buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic EnumRules.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<EnumRules.Builder>public EnumRules.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<EnumRules.Builder>public EnumRules.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<EnumRules.Builder>public EnumRules.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<EnumRules.Builder>public EnumRules.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<EnumRules.Builder>public EnumRules.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<EnumRules.Builder>public 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 EnumRules.Builder setConst(int value)
`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) = { ... }value - The const to set.public EnumRules.Builder clearConst()
`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) = { ... }public 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 EnumRules.Builder setDefinedOnly(boolean value)
`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"];value - The definedOnly to set.public EnumRules.Builder clearDefinedOnly()
`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"];public 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 EnumRules.Builder setIn(int index, int value)
`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 to set the value at.value - The in to set.public EnumRules.Builder addIn(int value)
`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) = { ... }value - The in to add.public EnumRules.Builder addAllIn(Iterable<? extends Integer> values)
`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) = { ... }values - The in to add.public EnumRules.Builder clearIn()
`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) = { ... }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 EnumRules.Builder setNotIn(int index, int value)
`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 to set the value at.value - The notIn to set.public EnumRules.Builder addNotIn(int value)
`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) = { ... }value - The notIn to add.public EnumRules.Builder addAllNotIn(Iterable<? extends Integer> values)
`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) = { ... }values - The notIn to add.public EnumRules.Builder clearNotIn()
`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) = { ... }public final EnumRules.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<EnumRules.Builder>public final EnumRules.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<EnumRules.Builder>Copyright © 2023. All rights reserved.