Package com.google.protobuf
Enum Class FieldType
- All Implemented Interfaces:
Serializable
,Comparable<FieldType>
,Constable
Enumeration identifying all relevant type information for a protobuf field.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic FieldType
forId
(int id) Looks up the appropriateFieldType
by it's identifier.Gets theJavaType
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
Indicates whether this field type represents a primitive scalar value.boolean
isScalar()
Indicates whether this field type represents a scalar value.boolean
isValidForField
(Field field) static FieldType
Returns the enum constant of this class with the specified name.static FieldType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DOUBLE
-
FLOAT
-
INT64
-
UINT64
-
INT32
-
FIXED64
-
FIXED32
-
BOOL
-
STRING
-
MESSAGE
-
BYTES
-
UINT32
-
ENUM
-
SFIXED32
-
SFIXED64
-
SINT32
-
SINT64
-
GROUP
-
DOUBLE_LIST
-
FLOAT_LIST
-
INT64_LIST
-
UINT64_LIST
-
INT32_LIST
-
FIXED64_LIST
-
FIXED32_LIST
-
BOOL_LIST
-
STRING_LIST
-
MESSAGE_LIST
-
BYTES_LIST
-
UINT32_LIST
-
ENUM_LIST
-
SFIXED32_LIST
-
SFIXED64_LIST
-
SINT32_LIST
-
SINT64_LIST
-
DOUBLE_LIST_PACKED
-
FLOAT_LIST_PACKED
-
INT64_LIST_PACKED
-
UINT64_LIST_PACKED
-
INT32_LIST_PACKED
-
FIXED64_LIST_PACKED
-
FIXED32_LIST_PACKED
-
BOOL_LIST_PACKED
-
UINT32_LIST_PACKED
-
ENUM_LIST_PACKED
-
SFIXED32_LIST_PACKED
-
SFIXED64_LIST_PACKED
-
SINT32_LIST_PACKED
-
SINT64_LIST_PACKED
-
GROUP_LIST
-
MAP
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
id
public int id()A reliable unique identifier for this type. -
getJavaType
Gets theJavaType
for this field. For lists, this identifies the type of the elements contained within the list. -
isPacked
public boolean isPacked()Indicates whether a list field should be represented on the wire in packed form. -
isPrimitiveScalar
public boolean isPrimitiveScalar()Indicates whether this field type represents a primitive scalar value. If this istrue
, thenisScalar()
will also betrue
. -
isScalar
public boolean isScalar()Indicates whether this field type represents a scalar value. -
isList
public boolean isList()Indicates whether this field represents a list of values. -
isMap
public boolean isMap()Indicates whether this field represents a map. -
isValidForField
-
forId
Looks up the appropriateFieldType
by it's identifier.- Returns:
- the
FieldType
ornull
if not found.
-