Class AbstractCLType
- java.lang.Object
-
- com.casper.sdk.model.clvalue.cltype.AbstractCLType
-
- Direct Known Subclasses:
AbstractCLTypeBasic,AbstractCLTypeWithChildren,CLTypeByteArray,CLTypeResult
public abstract class AbstractCLType extends java.lang.ObjectBasic class for CLType implementation- Since:
- 0.0.1
- See Also:
AbstractCLType
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringANYstatic java.lang.StringBOOLString constants for all CLTypes as defined by the api specstatic java.lang.StringBYTE_ARRAYstatic java.lang.StringFIXED_LISTstatic java.lang.StringI32static java.lang.StringI64static java.lang.StringKEYstatic java.lang.StringLISTstatic java.lang.StringMAPstatic java.lang.StringOPTIONstatic java.lang.StringPUBLIC_KEYstatic java.lang.StringRESULTstatic java.lang.StringSTRINGstatic java.lang.StringTUPLE1static java.lang.StringTUPLE2static java.lang.StringTUPLE3static java.lang.StringU128static java.lang.StringU256static java.lang.StringU32static java.lang.StringU512static java.lang.StringU64static java.lang.StringU8static java.lang.StringUNITstatic java.lang.StringUREF
-
Constructor Summary
Constructors Constructor Description AbstractCLType()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CLTypeDatagetClTypeData()abstract java.lang.StringgetTypeName()Required getter for implementations of CLTypeabstract booleanisDeserializable()Indicates if the CLType does not contain an 'Any', or other un-deserializable child type from bytes.voidserialize(dev.oak3.sbs4j.SerializerBuffer ser)Serializes the type to the provided buffer
-
-
-
Field Detail
-
BOOL
public static final java.lang.String BOOL
String constants for all CLTypes as defined by the api spec- See Also:
- Constant Field Values
-
I32
public static final java.lang.String I32
- See Also:
- Constant Field Values
-
I64
public static final java.lang.String I64
- See Also:
- Constant Field Values
-
U8
public static final java.lang.String U8
- See Also:
- Constant Field Values
-
U32
public static final java.lang.String U32
- See Also:
- Constant Field Values
-
U64
public static final java.lang.String U64
- See Also:
- Constant Field Values
-
U128
public static final java.lang.String U128
- See Also:
- Constant Field Values
-
U256
public static final java.lang.String U256
- See Also:
- Constant Field Values
-
U512
public static final java.lang.String U512
- See Also:
- Constant Field Values
-
UNIT
public static final java.lang.String UNIT
- See Also:
- Constant Field Values
-
STRING
public static final java.lang.String STRING
- See Also:
- Constant Field Values
-
KEY
public static final java.lang.String KEY
- See Also:
- Constant Field Values
-
UREF
public static final java.lang.String UREF
- See Also:
- Constant Field Values
-
OPTION
public static final java.lang.String OPTION
- See Also:
- Constant Field Values
-
LIST
public static final java.lang.String LIST
- See Also:
- Constant Field Values
-
FIXED_LIST
public static final java.lang.String FIXED_LIST
- See Also:
- Constant Field Values
-
RESULT
public static final java.lang.String RESULT
- See Also:
- Constant Field Values
-
MAP
public static final java.lang.String MAP
- See Also:
- Constant Field Values
-
TUPLE1
public static final java.lang.String TUPLE1
- See Also:
- Constant Field Values
-
TUPLE2
public static final java.lang.String TUPLE2
- See Also:
- Constant Field Values
-
TUPLE3
public static final java.lang.String TUPLE3
- See Also:
- Constant Field Values
-
ANY
public static final java.lang.String ANY
- See Also:
- Constant Field Values
-
PUBLIC_KEY
public static final java.lang.String PUBLIC_KEY
- See Also:
- Constant Field Values
-
BYTE_ARRAY
public static final java.lang.String BYTE_ARRAY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTypeName
public abstract java.lang.String getTypeName()
Required getter for implementations of CLType- Returns:
- the CLType name
-
getClTypeData
public CLTypeData getClTypeData() throws NoSuchTypeException
- Returns:
- the
CLTypeDatafor the current CLType - Throws:
NoSuchTypeException- thrown if no cl type data found
-
isDeserializable
public abstract boolean isDeserializable()
Indicates if the CLType does not contain an 'Any', or other un-deserializable child type from bytes. The reason for this is the 'Any' type does not provide a length for its bytes. This type information is obtained from the JSON metadata.- Returns:
- true if can be serialized, i.e: a child, or child's child does not contain a deserializable value such as an 'Any' type.
-
serialize
public void serialize(dev.oak3.sbs4j.SerializerBuffer ser) throws NoSuchTypeExceptionSerializes the type to the provided buffer- Parameters:
ser- the buffer to serialize to- Throws:
NoSuchTypeException- if the type is not supported
-
-