Enum Type
- java.lang.Object
-
- java.lang.Enum<Type>
-
- org.infinispan.protostream.descriptors.Type
-
- All Implemented Interfaces:
Serializable
,Comparable<Type>
public enum Type extends Enum<Type>
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
- Author:
- gustavonalle
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JavaType
getJavaType()
WireType
getWireType()
boolean
isUnsigned()
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
.String
toString()
static Type
valueOf(String name)
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 Detail
-
DOUBLE
public static final Type DOUBLE
-
FLOAT
public static final Type FLOAT
-
INT64
public static final Type INT64
-
UINT64
public static final Type UINT64
-
INT32
public static final Type INT32
-
FIXED64
public static final Type FIXED64
-
FIXED32
public static final Type FIXED32
-
BOOL
public static final Type BOOL
-
STRING
public static final Type STRING
-
BYTES
public static final Type BYTES
-
UINT32
public static final Type UINT32
-
SFIXED32
public static final Type SFIXED32
-
SFIXED64
public static final Type SFIXED64
-
SINT32
public static final Type SINT32
-
SINT64
public static final Type SINT64
-
GROUP
public static final Type GROUP
-
MESSAGE
public static final Type MESSAGE
-
ENUM
public static final Type ENUM
-
-
Method Detail
-
values
public static Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Type c : Type.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Type valueOf(String name)
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
public static Type primitiveFromString(String typeName)
If the type name is a primitive, it returns the corresponding enum constant, otherwise it returnsnull
.
-
getJavaType
public JavaType getJavaType()
-
getWireType
public WireType getWireType()
-
isUnsigned
public boolean isUnsigned()
Returnstrue
only if the type is an unsigned numeric type,false
otherwise.
-
-