public final class OneofConstraints extends com.google.protobuf.GeneratedMessageV3 implements OneofConstraintsOrBuilder
The `OneofConstraints` message type enables you to manage constraints for oneof fields in your protobuf messages.Protobuf type
buf.validate.OneofConstraints| Modifier and Type | Class and Description |
|---|---|
static class |
OneofConstraints.Builder
The `OneofConstraints` message type enables you to manage constraints for
oneof fields in your protobuf messages.
|
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 |
REQUIRED_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
static OneofConstraints |
getDefaultInstance() |
OneofConstraints |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Parser<OneofConstraints> |
getParserForType() |
boolean |
getRequired()
If `required` is true, exactly one field of the oneof must be present.
|
boolean |
hasRequired()
If `required` is true, exactly one field of the oneof must be present.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
static OneofConstraints.Builder |
newBuilder() |
static OneofConstraints.Builder |
newBuilder(OneofConstraints prototype) |
OneofConstraints.Builder |
newBuilderForType() |
protected OneofConstraints.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static OneofConstraints |
parseDelimitedFrom(InputStream input) |
static OneofConstraints |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static OneofConstraints |
parseFrom(byte[] data) |
static OneofConstraints |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static OneofConstraints |
parseFrom(ByteBuffer data) |
static OneofConstraints |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static OneofConstraints |
parseFrom(com.google.protobuf.ByteString data) |
static OneofConstraints |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static OneofConstraints |
parseFrom(com.google.protobuf.CodedInputStream input) |
static OneofConstraints |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static OneofConstraints |
parseFrom(InputStream input) |
static OneofConstraints |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<OneofConstraints> |
parser() |
OneofConstraints.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 REQUIRED_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 hasRequired()
If `required` is true, exactly one field of the oneof must be present. A
validation error is returned if no fields in the oneof are present. The
field itself may still be a default value; further constraints
should be placed on the fields themselves to ensure they are valid values,
such as `min_len` or `gt`.
```proto
message MyMessage {
oneof value {
// Either `a` or `b` must be set. If `a` is set, it must also be
// non-empty; whereas if `b` is set, it can still be an empty string.
option (buf.validate.oneof).required = true;
string a = 1 [(buf.validate.field).string.min_len = 1];
string b = 2;
}
}
```
optional bool required = 1 [json_name = "required"];hasRequired in interface OneofConstraintsOrBuilderpublic boolean getRequired()
If `required` is true, exactly one field of the oneof must be present. A
validation error is returned if no fields in the oneof are present. The
field itself may still be a default value; further constraints
should be placed on the fields themselves to ensure they are valid values,
such as `min_len` or `gt`.
```proto
message MyMessage {
oneof value {
// Either `a` or `b` must be set. If `a` is set, it must also be
// non-empty; whereas if `b` is set, it can still be an empty string.
option (buf.validate.oneof).required = true;
string a = 1 [(buf.validate.field).string.min_len = 1];
string b = 2;
}
}
```
optional bool required = 1 [json_name = "required"];getRequired in interface OneofConstraintsOrBuilderpublic static OneofConstraints parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OneofConstraints parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OneofConstraints parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OneofConstraints parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OneofConstraints parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OneofConstraints parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OneofConstraints parseFrom(InputStream input) throws IOException
IOExceptionpublic static OneofConstraints parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static OneofConstraints parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static OneofConstraints parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static OneofConstraints parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static OneofConstraints parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic OneofConstraints.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static OneofConstraints.Builder newBuilder()
public static OneofConstraints.Builder newBuilder(OneofConstraints prototype)
public OneofConstraints.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected OneofConstraints.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static OneofConstraints getDefaultInstance()
public static com.google.protobuf.Parser<OneofConstraints> parser()
public com.google.protobuf.Parser<OneofConstraints> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public OneofConstraints getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2023. All rights reserved.