Class 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 for int8, int16 and uint8; Integer for int24, int32, uint16 and uint24, 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 the instance.getTypeAsString() method.