Package com.klaytn.caver.abi.datatypes
Class AbiTypes
- java.lang.Object
-
- com.klaytn.caver.abi.datatypes.AbiTypes
-
public final class AbiTypes extends java.lang.Object
Maps Solidity types to caver-java data types, allowing to use Java primitive types for numbers. The used primitive type is the smallest that can hold a Solidity value for a specific bit length, e.g.Short
forint8
,int16
anduint8
;Integer
forint24
,int32
,uint16
anduint24
, etc.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Class<? extends Type>
getType(java.lang.String type)
Returns the caver-java data type for the given type, without using primitive types.static java.lang.Class<? extends Type>
getType(java.lang.String type, boolean primitives)
Returns the caver-java data type for the given type.static java.lang.String
getTypeAString(java.lang.Class<? extends Type> type)
Returns the provided class type as a string.
-
-
-
Method Detail
-
getType
public static java.lang.Class<? extends Type> getType(java.lang.String type)
Returns the caver-java data type for the given type, without using primitive types.- Parameters:
type
- A Solidity type.- Returns:
- The caver-java Java class to represent this Solidity type.
-
getType
public static java.lang.Class<? extends Type> getType(java.lang.String type, boolean primitives)
Returns the caver-java data type for the given type.- Parameters:
type
- A Solidity type.primitives
- Use Java primitive types to wrap contract parameters.- Returns:
- The caver-java Java class to represent this Solidity type.
-
getTypeAString
public static java.lang.String getTypeAString(java.lang.Class<? extends Type> type)
Returns the provided class type as a string. In case of a struct, it will return the struct name. For the tuple notation of a struct, example ((string,uint256)), think of taking an instance of the struct and calling theinstance.getTypeAsString()
method.
-
-