Package org.web3j.abi

Class Utils

java.lang.Object
org.web3j.abi.Utils

public class Utils extends Object
Utility functions.
  • Method Details

    • getStructType

      public static String getStructType(Class type)
    • getDynamicArrayTypeReference

      public static TypeReference<DynamicArray> getDynamicArrayTypeReference(Class parameter)
    • extractParameterFromAnnotation

      public static <T extends Type> Class<T> extractParameterFromAnnotation(Annotation[] parameterAnnotation)
    • findStructConstructor

      public static Constructor findStructConstructor(Class classType)
    • convert

      public static List<TypeReference<Type>> convert(List<TypeReference<?>> input)
    • typeMap

      public static <T, R extends Type<T>, E extends Type<T>> List<E> typeMap(List<List<T>> input, Class<E> outerDestType, Class<R> innerType)
    • typeMap

      public static <T, R extends Type<T>> List<R> typeMap(List<T> input, Class<R> destType) throws TypeMappingException
      Throws:
      TypeMappingException
    • staticStructNestedPublicFieldsFlatList

      public static List<Field> staticStructNestedPublicFieldsFlatList(Class<Type> classType)
      Returns flat list of canonical fields in a static struct. Example: struct Baz { Struct Bar { int a, int b }, int c } will return {a, b, c}.
      Parameters:
      classType - Static struct type
      Returns:
      Flat list of canonical fields in a nested struct
    • staticStructsNestedFieldsFlatList

      public static List<Field> staticStructsNestedFieldsFlatList(Class<Type> classType)
      Goes over a static structs and enumerates all of its fields and nested structs fields recursively.
      Parameters:
      classType - Static struct type
      Returns:
      Flat list of all the fields nested in the struct
    • getTypeName

      public static String getTypeName(Type type)