Package org.web3j.abi
Class Utils
java.lang.Object
org.web3j.abi.Utils
Utility functions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<TypeReference<Type>>convert(List<TypeReference<?>> input) extractParameterFromAnnotation(Annotation[] parameterAnnotation) static ConstructorfindStructConstructor(Class classType) static TypeReference<DynamicArray>getDynamicArrayTypeReference(Class parameter) static StringgetStructType(Class type) static StringgetTypeName(Type type) PortsType.getTypeName().staticStructNestedPublicFieldsFlatList(Class<Type> classType) Returns flat list of canonical fields in a static struct.staticStructsNestedFieldsFlatList(Class<Type> classType) Goes over a static structs and enumerates all of its fields and nested structs fields recursively.
-
Method Details
-
getStructType
-
getDynamicArrayTypeReference
-
extractParameterFromAnnotation
public static <T extends Type> Class<T> extractParameterFromAnnotation(Annotation[] parameterAnnotation) -
findStructConstructor
-
convert
-
typeMap
-
typeMap
public static <T,R extends Type<T>> List<R> typeMap(List<T> input, Class<R> destType) throws TypeMappingException - Throws:
TypeMappingException
-
staticStructNestedPublicFieldsFlatList
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
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
PortsType.getTypeName().
-