Enum Class Type
- All Implemented Interfaces:
Serializable,Comparable<Type>,Constable
Type of a field in Protobuf, can be any value defined in https://developers.google.com/protocol-buffers/docs/proto3#scalar
or a group, message and enum.
- Since:
- 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueonly if the type is an unsigned numeric type,falseotherwise.booleanstatic TypeprimitiveFromString(String typeName) If the type name is a primitive, it returns the corresponding enum constant, otherwise it returnsnull.toString()static TypeReturns the enum constant of this class with the specified name.static Type[]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
-
BYTES
-
UINT32
-
SFIXED32
-
SFIXED64
-
SINT32
-
SINT64
-
GROUP
-
MESSAGE
-
ENUM
-
MAP
-
-
Field Details
-
javaType
-
wireType
-
-
Constructor Details
-
Type
-
-
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
-
primitiveFromString
If the type name is a primitive, it returns the corresponding enum constant, otherwise it returnsnull. -
getJavaType
-
getWireType
-
isUnsigned
public boolean isUnsigned()Returnstrueonly if the type is an unsigned numeric type,falseotherwise. -
isValidMapKey
public boolean isValidMapKey() -
toString
-