@ExperimentalApi public enum FieldType extends java.lang.Enum<FieldType>
Modifier and Type | Method and Description |
---|---|
static FieldType |
forId(int id)
Looks up the appropriate
FieldType by it's identifier. |
JavaType |
getJavaType()
Gets the
JavaType for this field. |
int |
id()
A reliable unique identifier for this type.
|
boolean |
isList()
Indicates whether this field represents a list of values.
|
boolean |
isMap()
Indicates whether this field represents a map.
|
boolean |
isPacked()
Indicates whether a list field should be represented on the wire in packed form.
|
boolean |
isPrimitiveScalar()
Indicates whether this field type represents a primitive scalar value.
|
boolean |
isScalar()
Indicates whether this field type represents a scalar value.
|
boolean |
isValidForField(java.lang.reflect.Field field)
|
static FieldType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static FieldType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final FieldType DOUBLE
public static final FieldType FLOAT
public static final FieldType INT64
public static final FieldType UINT64
public static final FieldType INT32
public static final FieldType FIXED64
public static final FieldType FIXED32
public static final FieldType BOOL
public static final FieldType STRING
public static final FieldType MESSAGE
public static final FieldType BYTES
public static final FieldType UINT32
public static final FieldType ENUM
public static final FieldType SFIXED32
public static final FieldType SFIXED64
public static final FieldType SINT32
public static final FieldType SINT64
public static final FieldType GROUP
public static final FieldType DOUBLE_LIST
public static final FieldType FLOAT_LIST
public static final FieldType INT64_LIST
public static final FieldType UINT64_LIST
public static final FieldType INT32_LIST
public static final FieldType FIXED64_LIST
public static final FieldType FIXED32_LIST
public static final FieldType BOOL_LIST
public static final FieldType STRING_LIST
public static final FieldType MESSAGE_LIST
public static final FieldType BYTES_LIST
public static final FieldType UINT32_LIST
public static final FieldType ENUM_LIST
public static final FieldType SFIXED32_LIST
public static final FieldType SFIXED64_LIST
public static final FieldType SINT32_LIST
public static final FieldType SINT64_LIST
public static final FieldType DOUBLE_LIST_PACKED
public static final FieldType FLOAT_LIST_PACKED
public static final FieldType INT64_LIST_PACKED
public static final FieldType UINT64_LIST_PACKED
public static final FieldType INT32_LIST_PACKED
public static final FieldType FIXED64_LIST_PACKED
public static final FieldType FIXED32_LIST_PACKED
public static final FieldType BOOL_LIST_PACKED
public static final FieldType UINT32_LIST_PACKED
public static final FieldType ENUM_LIST_PACKED
public static final FieldType SFIXED32_LIST_PACKED
public static final FieldType SFIXED64_LIST_PACKED
public static final FieldType SINT32_LIST_PACKED
public static final FieldType SINT64_LIST_PACKED
public static final FieldType GROUP_LIST
public static final FieldType MAP
public static FieldType[] values()
for (FieldType c : FieldType.values()) System.out.println(c);
public static FieldType 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 int id()
public JavaType getJavaType()
JavaType
for this field. For lists, this identifies the type of the elements
contained within the list.public boolean isPacked()
public boolean isPrimitiveScalar()
true
,
then isScalar()
will also be true
.public boolean isScalar()
public boolean isList()
public boolean isMap()
public boolean isValidForField(java.lang.reflect.Field field)