Enum PrimitiveType.Kind
- java.lang.Object
-
- java.lang.Enum<PrimitiveType.Kind>
-
- de.haumacher.msgbuf.generator.ast.PrimitiveType.Kind
-
- All Implemented Interfaces:
ProtocolEnum,Serializable,Comparable<PrimitiveType.Kind>
- Enclosing class:
- PrimitiveType
public static enum PrimitiveType.Kind extends Enum<PrimitiveType.Kind> implements ProtocolEnum
Supported built-in types.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLA boolean.BYTESA string of octets.DOUBLEA 64 bit floating point number.FIXED_32A 32 bit integer without runlength encoding.FIXED_64A 64 bit integer without runlength encoding.FLOATA 32 bit floating point number.INT_32A 32 bit integer.INT_64A 64 bit integer.SFIXED_32A signed 32 bit integer without runlength encoding.SFIXED_64A signed 64 bit integer without runlength encoding.SINT_32A signed 32 bit integer.SINT_64A signed 64 bit integer.STRINGA string of characters.UINT_32An unsigned 32 bit integer.UINT_64An unsigned 64 bit integer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringprotocolName()The protocol name of aPrimitiveType.Kindconstant.static PrimitiveType.KindreadKind(DataReader in)Reads a new instance from the given binary reader.static PrimitiveType.KindreadKind(JsonReader in)Reads a new instance from the given reader.static PrimitiveType.KindvalueOf(String name)Returns the enum constant of this type with the specified name.static PrimitiveType.KindvalueOfProtocol(String protocolName)Looks up aPrimitiveType.Kindconstant by it's protocol name.static PrimitiveType.Kind[]values()Returns an array containing the constants of this enum type, in the order they are declared.voidwriteTo(DataWriter out)Writes this instance to the given binary output.voidwriteTo(JsonWriter out)Writes this instance to the given output.
-
-
-
Enum Constant Detail
-
INT_32
public static final PrimitiveType.Kind INT_32
A 32 bit integer.
-
UINT_32
public static final PrimitiveType.Kind UINT_32
An unsigned 32 bit integer.
-
SINT_32
public static final PrimitiveType.Kind SINT_32
A signed 32 bit integer.
-
FIXED_32
public static final PrimitiveType.Kind FIXED_32
A 32 bit integer without runlength encoding.
-
SFIXED_32
public static final PrimitiveType.Kind SFIXED_32
A signed 32 bit integer without runlength encoding.
-
INT_64
public static final PrimitiveType.Kind INT_64
A 64 bit integer.
-
UINT_64
public static final PrimitiveType.Kind UINT_64
An unsigned 64 bit integer.
-
SINT_64
public static final PrimitiveType.Kind SINT_64
A signed 64 bit integer.
-
FIXED_64
public static final PrimitiveType.Kind FIXED_64
A 64 bit integer without runlength encoding.
-
SFIXED_64
public static final PrimitiveType.Kind SFIXED_64
A signed 64 bit integer without runlength encoding.
-
BOOL
public static final PrimitiveType.Kind BOOL
A boolean.
-
STRING
public static final PrimitiveType.Kind STRING
A string of characters.
-
FLOAT
public static final PrimitiveType.Kind FLOAT
A 32 bit floating point number.
-
DOUBLE
public static final PrimitiveType.Kind DOUBLE
A 64 bit floating point number.
-
BYTES
public static final PrimitiveType.Kind BYTES
A string of octets.
-
-
Method Detail
-
values
public static PrimitiveType.Kind[] 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 (PrimitiveType.Kind c : PrimitiveType.Kind.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PrimitiveType.Kind 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
-
protocolName
public String protocolName()
The protocol name of aPrimitiveType.Kindconstant.- Specified by:
protocolNamein interfaceProtocolEnum- See Also:
valueOfProtocol(String)
-
valueOfProtocol
public static PrimitiveType.Kind valueOfProtocol(String protocolName)
Looks up aPrimitiveType.Kindconstant by it's protocol name.
-
writeTo
public final void writeTo(JsonWriter out) throws IOException
Writes this instance to the given output.- Throws:
IOException
-
readKind
public static PrimitiveType.Kind readKind(JsonReader in) throws IOException
Reads a new instance from the given reader.- Throws:
IOException
-
writeTo
public final void writeTo(DataWriter out) throws IOException
Writes this instance to the given binary output.- Throws:
IOException
-
readKind
public static PrimitiveType.Kind readKind(DataReader in) throws IOException
Reads a new instance from the given binary reader.- Throws:
IOException
-
-