Enum PrimitiveType.Kind
- java.lang.Object
-
- java.lang.Enum<PrimitiveType.Kind>
-
- de.haumacher.msgbuf.generator.ast.PrimitiveType.Kind
-
- All Implemented Interfaces:
de.haumacher.msgbuf.data.ProtocolEnum,Serializable,Comparable<PrimitiveType.Kind>
- Enclosing class:
- PrimitiveType
public static enum PrimitiveType.Kind extends Enum<PrimitiveType.Kind> implements de.haumacher.msgbuf.data.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_32FIXED_64FLOATA 32 bit floating point number.INT_32A 32 bit integer.INT_64A 64 bit integer.SFIXED_32SFIXED_64SINT_32SINT_64STRINGA string of characters.UINT_32UINT_64
-
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(de.haumacher.msgbuf.binary.DataReader in)Reads a new instance from the given binary reader.static PrimitiveType.KindreadKind(de.haumacher.msgbuf.json.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(de.haumacher.msgbuf.binary.DataWriter out)Writes this instance to the given binary output.voidwriteTo(de.haumacher.msgbuf.json.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
-
SINT_32
public static final PrimitiveType.Kind SINT_32
-
FIXED_32
public static final PrimitiveType.Kind FIXED_32
-
SFIXED_32
public static final PrimitiveType.Kind SFIXED_32
-
INT_64
public static final PrimitiveType.Kind INT_64
A 64 bit integer.
-
UINT_64
public static final PrimitiveType.Kind UINT_64
-
SINT_64
public static final PrimitiveType.Kind SINT_64
-
FIXED_64
public static final PrimitiveType.Kind FIXED_64
-
SFIXED_64
public static final PrimitiveType.Kind SFIXED_64
-
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 interfacede.haumacher.msgbuf.data.ProtocolEnum- 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(de.haumacher.msgbuf.json.JsonWriter out) throws IOExceptionWrites this instance to the given output.- Throws:
IOException
-
readKind
public static PrimitiveType.Kind readKind(de.haumacher.msgbuf.json.JsonReader in) throws IOException
Reads a new instance from the given reader.- Throws:
IOException
-
writeTo
public final void writeTo(de.haumacher.msgbuf.binary.DataWriter out) throws IOExceptionWrites this instance to the given binary output.- Throws:
IOException
-
readKind
public static PrimitiveType.Kind readKind(de.haumacher.msgbuf.binary.DataReader in) throws IOException
Reads a new instance from the given binary reader.- Throws:
IOException
-
-