Enum Type
- All Implemented Interfaces:
Serializable
,Comparable<Type>
,java.lang.constant.Constable
Type of a field in Protobuf, can be any value defined in https://developers.google.com/protocol-buffers/docs/proto3#scalar
plus composite types group, message and enum.
- Since:
- 2.0
- Author:
- gustavonalle
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
Returnstrue
only if the type is an unsigned numeric type,false
otherwise.static Type
primitiveFromString
(String typeName) If the type name is a primitive, it returns the corresponding enum constant, otherwise it returnsnull
.toString()
static Type
Returns the enum constant of this type with the specified name.static Type[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
DOUBLE
-
FLOAT
-
INT64
-
UINT64
-
INT32
-
FIXED64
-
FIXED32
-
BOOL
-
STRING
-
BYTES
-
UINT32
-
SFIXED32
-
SFIXED64
-
SINT32
-
SINT64
-
GROUP
-
MESSAGE
-
ENUM
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
primitiveFromString
If the type name is a primitive, it returns the corresponding enum constant, otherwise it returnsnull
. -
getJavaType
-
getWireType
public int getWireType() -
isUnsigned
public boolean isUnsigned()Returnstrue
only if the type is an unsigned numeric type,false
otherwise. -
toString
-