Package protopoet
Enum FieldType
- java.lang.Object
-
- java.lang.Enum<FieldType>
-
- protopoet.FieldType
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FieldType
inferFrom(java.lang.Object value)
Attempts to guess at the FieldType based on the provided value.java.lang.String
toString()
static FieldType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static FieldType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DOUBLE
public static final FieldType DOUBLE
-
FLOAT
public static final FieldType FLOAT
-
INT32
public static final FieldType INT32
-
INT64
public static final FieldType INT64
-
UINT32
public static final FieldType UINT32
-
UINT64
public static final FieldType UINT64
-
SINT32
public static final FieldType SINT32
-
SINT64
public static final FieldType SINT64
-
FIXED32
public static final FieldType FIXED32
-
FIXED64
public static final FieldType FIXED64
-
SFIXED32
public static final FieldType SFIXED32
-
SFIXED64
public static final FieldType SFIXED64
-
BOOL
public static final FieldType BOOL
-
STRING
public static final FieldType STRING
-
BYTES
public static final FieldType BYTES
-
MESSAGE
public static final FieldType MESSAGE
-
ENUM
public static final FieldType ENUM
-
-
Method Detail
-
values
public static FieldType[] 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 (FieldType c : FieldType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FieldType valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
inferFrom
public static FieldType inferFrom(java.lang.Object value)
Attempts to guess at the FieldType based on the provided value. Note, this outputs INT32 forInteger and INT64 for Long, if you need more specific types for numerics, don't use this.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<FieldType>
-
-