Package de.gsi.dataset.utils.serializer
Enum DataType
- java.lang.Object
-
- java.lang.Enum<DataType>
-
- de.gsi.dataset.utils.serializer.DataType
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLBOOL_ARRAYBYTEBYTE_ARRAYDOUBLEDOUBLE_ARRAYEND_MARKERFLOATFLOAT_ARRAYINTINT_ARRAYLONGLONG_ARRAYMAPSHORTSHORT_ARRAYSTRINGSTRING_ARRAY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DataTypefromByte(byte value)Returns the data type matching the given byte representation, if any.static DataTypefromClassType(java.lang.Class<?> classType)Returns the data type matching the given java class type, if any.static DataTypefromString(java.lang.String str)Returns the data type matching the given string representation, if any.bytegetAsByte()Returns the byte representation of the data type.java.lang.StringgetAsString()Returns the string representation of the data type.java.lang.Class<?>getClassType()Returns the corresponding java class type matching the given data typelonggetPrimitiveSize()booleanisScalar()java.lang.StringtoString()static DataTypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static DataType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BOOL
public static final DataType BOOL
-
BYTE
public static final DataType BYTE
-
SHORT
public static final DataType SHORT
-
INT
public static final DataType INT
-
LONG
public static final DataType LONG
-
FLOAT
public static final DataType FLOAT
-
DOUBLE
public static final DataType DOUBLE
-
STRING
public static final DataType STRING
-
BOOL_ARRAY
public static final DataType BOOL_ARRAY
-
BYTE_ARRAY
public static final DataType BYTE_ARRAY
-
SHORT_ARRAY
public static final DataType SHORT_ARRAY
-
INT_ARRAY
public static final DataType INT_ARRAY
-
LONG_ARRAY
public static final DataType LONG_ARRAY
-
FLOAT_ARRAY
public static final DataType FLOAT_ARRAY
-
DOUBLE_ARRAY
public static final DataType DOUBLE_ARRAY
-
STRING_ARRAY
public static final DataType STRING_ARRAY
-
MAP
public static final DataType MAP
-
END_MARKER
public static final DataType END_MARKER
-
-
Method Detail
-
values
public static DataType[] 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 (DataType c : DataType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DataType 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
-
getAsByte
public byte getAsByte()
Returns the byte representation of the data type.- Returns:
- the byte representation
-
getPrimitiveSize
public long getPrimitiveSize()
-
getClassType
public java.lang.Class<?> getClassType()
Returns the corresponding java class type matching the given data type- Returns:
- the matching java class type
-
isScalar
public boolean isScalar()
-
getAsString
public java.lang.String getAsString()
Returns the string representation of the data type.- Returns:
- the string representation
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Enum<DataType>
-
fromString
public static DataType fromString(java.lang.String str)
Returns the data type matching the given string representation, if any.- Parameters:
str- the string to be searched- Returns:
- the matching data type
-
fromByte
public static DataType fromByte(byte value)
Returns the data type matching the given byte representation, if any.- Parameters:
value- the value to be searched- Returns:
- the matching data type
-
fromClassType
public static DataType fromClassType(java.lang.Class<?> classType)
Returns the data type matching the given java class type, if any.- Parameters:
classType- the value to be searched- Returns:
- the matching data type
-
-