Enum CLTypeData
- java.lang.Object
-
- java.lang.Enum<CLTypeData>
-
- com.casper.sdk.model.clvalue.cltype.CLTypeData
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<CLTypeData>
public enum CLTypeData extends java.lang.Enum<CLTypeData>
Casper CLType definitions and type mappingsAll types must be listed and mapped here.
- Since:
- 0.0.1
- See Also:
StoredValue
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AbstractCLTypecreateCLTypeFromCLTypeData(CLTypeData clTypeData)Dynamically instantiate a CLType when needed for decoding children objectsstatic AbstractCLTypecreateCLTypeFromCLTypeName(java.lang.String clTypeName)Dynamically instantiate a CLType when needed for decoding children objectsstatic AbstractCLValue<?,?>createCLValueFromCLTypeData(CLTypeData clTypeData)Dynamically instantiate a CLValue when needed for decoding children objectsstatic AbstractCLValue<?,?>createCLValueFromCLTypeName(java.lang.String clValueName)Dynamically instantiate a CLValue when needed for decoding children objectsstatic java.lang.Class<?>getClassByName(java.lang.String name)Retrieve CLValue implementation class from CLType namejava.lang.Class<? extends AbstractCLValue<?,?>>getClazz()java.lang.Class<? extends AbstractCLType>getClTypeClass()static java.lang.Class<?>getCLTypeClassByName(java.lang.String name)Retrieve CLType class from CLType namejava.lang.StringgetClTypeName()bytegetSerializationTag()static CLTypeDatagetTypeByName(java.lang.String name)Retrieve CLType from its namestatic CLTypeDatagetTypeBySerializationTag(byte serializationTag)Retrieve CLType by its serialization tagstatic CLTypeDatavalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static CLTypeData[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BOOL
public static final CLTypeData BOOL
-
I32
public static final CLTypeData I32
-
I64
public static final CLTypeData I64
-
U8
public static final CLTypeData U8
-
U32
public static final CLTypeData U32
-
U64
public static final CLTypeData U64
-
U128
public static final CLTypeData U128
-
U256
public static final CLTypeData U256
-
U512
public static final CLTypeData U512
-
UNIT
public static final CLTypeData UNIT
-
STRING
public static final CLTypeData STRING
-
UREF
public static final CLTypeData UREF
-
KEY
public static final CLTypeData KEY
-
OPTION
public static final CLTypeData OPTION
-
LIST
public static final CLTypeData LIST
-
FIXED_LIST
public static final CLTypeData FIXED_LIST
-
RESULT
public static final CLTypeData RESULT
-
MAP
public static final CLTypeData MAP
-
TUPLE1
public static final CLTypeData TUPLE1
-
TUPLE2
public static final CLTypeData TUPLE2
-
TUPLE3
public static final CLTypeData TUPLE3
-
ANY
public static final CLTypeData ANY
-
PUBLIC_KEY
public static final CLTypeData PUBLIC_KEY
-
BYTE_ARRAY
public static final CLTypeData BYTE_ARRAY
-
-
Method Detail
-
values
public static CLTypeData[] 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 (CLTypeData c : CLTypeData.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CLTypeData 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
-
getTypeBySerializationTag
public static CLTypeData getTypeBySerializationTag(byte serializationTag) throws NoSuchTypeException
Retrieve CLType by its serialization tag- Parameters:
serializationTag- the serialization tag to find- Returns:
- the requested
CLTypeData - Throws:
NoSuchTypeException- raised when the clType is not valid/found
-
getClassByName
public static java.lang.Class<?> getClassByName(java.lang.String name) throws NoSuchTypeExceptionRetrieve CLValue implementation class from CLType name- Parameters:
name- the type's name- Returns:
- the
Classobject holding the requestedAbstractCLValue - Throws:
NoSuchTypeException- raised when the clType is not valid/found
-
getCLTypeClassByName
public static java.lang.Class<?> getCLTypeClassByName(java.lang.String name) throws NoSuchTypeExceptionRetrieve CLType class from CLType name- Parameters:
name- the type's name- Returns:
- the
Classobject holding the requestedAbstractCLType - Throws:
NoSuchTypeException- raised when the clType is not valid/found
-
getTypeByName
public static CLTypeData getTypeByName(java.lang.String name) throws NoSuchTypeException
Retrieve CLType from its name- Parameters:
name- the type's name- Returns:
- the requested
CLTypeData - Throws:
NoSuchTypeException- raised when the clType is not valid/found
-
createCLValueFromCLTypeName
public static AbstractCLValue<?,?> createCLValueFromCLTypeName(java.lang.String clValueName) throws DynamicInstanceException, NoSuchTypeException
Dynamically instantiate a CLValue when needed for decoding children objects- Parameters:
clValueName- the name of theAbstractCLValueto instantiate- Returns:
- the desired
AbstractCLValueimplementation - Throws:
DynamicInstanceException- error while dynamically instantiating the clValueNoSuchTypeException- raised when the clType is not valid/found
-
createCLValueFromCLTypeData
public static AbstractCLValue<?,?> createCLValueFromCLTypeData(CLTypeData clTypeData) throws DynamicInstanceException
Dynamically instantiate a CLValue when needed for decoding children objects- Parameters:
clTypeData- theCLTypeDatato instantiate- Returns:
- the desired
AbstractCLValueimplementation - Throws:
DynamicInstanceException- error while dynamically instantiating the clValue
-
createCLTypeFromCLTypeName
public static AbstractCLType createCLTypeFromCLTypeName(java.lang.String clTypeName) throws DynamicInstanceException, NoSuchTypeException
Dynamically instantiate a CLType when needed for decoding children objects- Parameters:
clTypeName- the name of theAbstractCLTypeto instantiate- Returns:
- the desired
AbstractCLTypeimplementation - Throws:
DynamicInstanceException- error while dynamically instantiating the clValueNoSuchTypeException- raised when the clType is not valid/found
-
createCLTypeFromCLTypeData
public static AbstractCLType createCLTypeFromCLTypeData(CLTypeData clTypeData) throws DynamicInstanceException
Dynamically instantiate a CLType when needed for decoding children objects- Parameters:
clTypeData- theCLTypeDatato instantiate- Returns:
- the desired
AbstractCLTypeimplementation - Throws:
DynamicInstanceException- error while dynamically instantiating the clValue
-
getClTypeName
public java.lang.String getClTypeName()
-
getSerializationTag
public byte getSerializationTag()
-
getClazz
public java.lang.Class<? extends AbstractCLValue<?,?>> getClazz()
-
getClTypeClass
public java.lang.Class<? extends AbstractCLType> getClTypeClass()
-
-