public static enum Field.Cardinality extends java.lang.Enum<Field.Cardinality> implements ProtocolMessageEnum
Whether a field is optional, required, or repeated.Protobuf enum
google.protobuf.Field.Cardinality
Enum Constant and Description |
---|
CARDINALITY_OPTIONAL
For optional fields.
|
CARDINALITY_REPEATED
For repeated fields.
|
CARDINALITY_REQUIRED
For required fields.
|
CARDINALITY_UNKNOWN
For fields with unknown cardinality.
|
UNRECOGNIZED |
Modifier and Type | Field and Description |
---|---|
static int |
CARDINALITY_OPTIONAL_VALUE
For optional fields.
|
static int |
CARDINALITY_REPEATED_VALUE
For repeated fields.
|
static int |
CARDINALITY_REQUIRED_VALUE
For required fields.
|
static int |
CARDINALITY_UNKNOWN_VALUE
For fields with unknown cardinality.
|
Modifier and Type | Method and Description |
---|---|
static Field.Cardinality |
forNumber(int value) |
static Descriptors.EnumDescriptor |
getDescriptor() |
Descriptors.EnumDescriptor |
getDescriptorForType()
Return the enum type's descriptor, which contains information about each defined value, etc.
|
int |
getNumber()
Return the value's numeric value as defined in the .proto file.
|
Descriptors.EnumValueDescriptor |
getValueDescriptor()
Return the value's descriptor, which contains information such as value name, number, and type.
|
static Internal.EnumLiteMap<Field.Cardinality> |
internalGetValueMap() |
static Field.Cardinality |
valueOf(Descriptors.EnumValueDescriptor desc) |
static Field.Cardinality |
valueOf(int value)
Deprecated.
Use
forNumber(int) instead. |
static Field.Cardinality |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Field.Cardinality[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Field.Cardinality CARDINALITY_UNKNOWN
For fields with unknown cardinality.
CARDINALITY_UNKNOWN = 0;
public static final Field.Cardinality CARDINALITY_OPTIONAL
For optional fields.
CARDINALITY_OPTIONAL = 1;
public static final Field.Cardinality CARDINALITY_REQUIRED
For required fields. Proto2 syntax only.
CARDINALITY_REQUIRED = 2;
public static final Field.Cardinality CARDINALITY_REPEATED
For repeated fields.
CARDINALITY_REPEATED = 3;
public static final Field.Cardinality UNRECOGNIZED
public static final int CARDINALITY_UNKNOWN_VALUE
For fields with unknown cardinality.
CARDINALITY_UNKNOWN = 0;
public static final int CARDINALITY_OPTIONAL_VALUE
For optional fields.
CARDINALITY_OPTIONAL = 1;
public static final int CARDINALITY_REQUIRED_VALUE
For required fields. Proto2 syntax only.
CARDINALITY_REQUIRED = 2;
public static final int CARDINALITY_REPEATED_VALUE
For repeated fields.
CARDINALITY_REPEATED = 3;
public static Field.Cardinality[] values()
for (Field.Cardinality c : Field.Cardinality.values()) System.out.println(c);
public static Field.Cardinality valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic final int getNumber()
ProtocolMessageEnum
getNumber
in interface Internal.EnumLite
getNumber
in interface ProtocolMessageEnum
@Deprecated public static Field.Cardinality valueOf(int value)
forNumber(int)
instead.public static Field.Cardinality forNumber(int value)
public static Internal.EnumLiteMap<Field.Cardinality> internalGetValueMap()
public final Descriptors.EnumValueDescriptor getValueDescriptor()
ProtocolMessageEnum
getValueDescriptor
in interface ProtocolMessageEnum
public final Descriptors.EnumDescriptor getDescriptorForType()
ProtocolMessageEnum
getDescriptorForType
in interface ProtocolMessageEnum
public static final Descriptors.EnumDescriptor getDescriptor()
public static Field.Cardinality valueOf(Descriptors.EnumValueDescriptor desc)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.