Package io.protostuff.compiler.model
Enum ScalarFieldType
- java.lang.Object
-
- java.lang.Enum<ScalarFieldType>
-
- io.protostuff.compiler.model.ScalarFieldType
-
- All Implemented Interfaces:
FieldType,Type,Serializable,Comparable<ScalarFieldType>
public enum ScalarFieldType extends Enum<ScalarFieldType> implements FieldType
Field types for scalar value types. See https://developers.google.com/protocol-buffers/docs/proto#scalar- Author:
- Kostiantyn Shchepanovskyi
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ScalarFieldTypegetByName(String name)Get scalar type by its reference/name.StringgetCanonicalName()ReturnsFieldType.getFullyQualifiedName()without leading dot.StringgetFullyQualifiedName()Type reference.StringgetName()booleanisBytes()booleanisEnum()Test if this type is enum.booleanisMap()Test if this type is map.booleanisMessage()Test if this type is message.booleanisScalar()Test if this type is scalar.booleanisString()StringtoString()static ScalarFieldTypevalueOf(String name)Returns the enum constant of this type with the specified name.static ScalarFieldType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INT32
public static final ScalarFieldType INT32
-
INT64
public static final ScalarFieldType INT64
-
UINT32
public static final ScalarFieldType UINT32
-
UINT64
public static final ScalarFieldType UINT64
-
SINT32
public static final ScalarFieldType SINT32
-
SINT64
public static final ScalarFieldType SINT64
-
FIXED32
public static final ScalarFieldType FIXED32
-
FIXED64
public static final ScalarFieldType FIXED64
-
SFIXED32
public static final ScalarFieldType SFIXED32
-
SFIXED64
public static final ScalarFieldType SFIXED64
-
FLOAT
public static final ScalarFieldType FLOAT
-
DOUBLE
public static final ScalarFieldType DOUBLE
-
BOOL
public static final ScalarFieldType BOOL
-
STRING
public static final ScalarFieldType STRING
-
BYTES
public static final ScalarFieldType BYTES
-
-
Method Detail
-
values
public static ScalarFieldType[] 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 (ScalarFieldType c : ScalarFieldType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ScalarFieldType 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
-
getByName
public static ScalarFieldType getByName(String name)
Get scalar type by its reference/name. Scalar type names are:int32int64uint32uint64sint32sint64fixed32fixed64sfixed32sfixed64floatdoubleboolstringbytes
-
getName
public String getName()
-
getFullyQualifiedName
public String getFullyQualifiedName()
Description copied from interface:FieldTypeType reference. For scalar types, it returns one of:int32int64uint32uint64sint32sint64fixed32fixed64sfixed32sfixed64floatdoubleboolstringbytes
For messages, it is full massage name. For enums, it is full enum name.
- Specified by:
getFullyQualifiedNamein interfaceFieldType- Specified by:
getFullyQualifiedNamein interfaceType
-
getCanonicalName
public String getCanonicalName()
Description copied from interface:FieldTypeReturnsFieldType.getFullyQualifiedName()without leading dot.- Specified by:
getCanonicalNamein interfaceFieldType- Specified by:
getCanonicalNamein interfaceType
-
isScalar
public boolean isScalar()
Description copied from interface:FieldTypeTest if this type is scalar.
-
isEnum
public boolean isEnum()
Description copied from interface:FieldTypeTest if this type is enum.
-
isMessage
public boolean isMessage()
Description copied from interface:FieldTypeTest if this type is message.
-
isMap
public boolean isMap()
Description copied from interface:FieldTypeTest if this type is map.
-
isString
public boolean isString()
-
isBytes
public boolean isBytes()
-
toString
public String toString()
- Overrides:
toStringin classEnum<ScalarFieldType>
-
-