@Test public void testGetTypeName() throws ClassNotFoundException { assertThat(Utils.getTypeName(new TypeReference<Uint>(){}), is("uint256")); assertThat(Utils.getTypeName(new TypeReference<Int>(){}), is("int256")); assertThat(Utils.getTypeName(new TypeReference<Ufixed>(){}), is("ufixed256")); assertThat(Utils.getTypeName(new TypeReference<Fixed>(){}), is("fixed256")); assertThat(Utils.getTypeName(new TypeReference<Uint64>(){}), is("uint64")); assertThat(Utils.getTypeName(new TypeReference<Int64>(){}), is("int64")); assertThat(Utils.getTypeName(new TypeReference<Bool>(){}), is("bool")); assertThat(Utils.getTypeName(new TypeReference<Utf8String>(){}), is("string")); assertThat(Utils.getTypeName(new TypeReference<DynamicBytes>(){}), is("bytes")); assertThat(Utils.getTypeName( new TypeReference.StaticArrayTypeReference<StaticArray<Uint>>(5){}), is("uint256[5]")); assertThat(Utils.getTypeName( new TypeReference<DynamicArray<Uint>>(){}), is("uint256[]")); }
static <T extends Type> String getTypeName(TypeReference<T> typeReference) { try { java.lang.reflect.Type reflectedType = typeReference.getType(); Class<?> type; if (reflectedType instanceof ParameterizedType) { type = (Class<?>) ((ParameterizedType) reflectedType).getRawType(); return getParameterizedTypeName(typeReference, type); } else { type = Class.forName(reflectedType.getTypeName()); return getSimpleTypeName(type); } } catch (ClassNotFoundException e) { throw new UnsupportedOperationException("Invalid class reference provided", e); } }
Utils { static <T extends Type> String getTypeName(TypeReference<T> typeReference) { try { java.lang.reflect.Type reflectedType = typeReference.getType(); Class<?> type; if (reflectedType instanceof ParameterizedType) { type = (Class<?>) ((ParameterizedType) reflectedType).getRawType(); return getParameterizedTypeName(typeReference, type); } else { type = Class.forName(reflectedType.getTypeName()); return getSimpleTypeName(type); } } catch (ClassNotFoundException e) { throw new UnsupportedOperationException("Invalid class reference provided", e); } } }
Utils { static <T extends Type> String getTypeName(TypeReference<T> typeReference) { try { java.lang.reflect.Type reflectedType = typeReference.getType(); Class<?> type; if (reflectedType instanceof ParameterizedType) { type = (Class<?>) ((ParameterizedType) reflectedType).getRawType(); return getParameterizedTypeName(typeReference, type); } else { type = Class.forName(reflectedType.getTypeName()); return getSimpleTypeName(type); } } catch (ClassNotFoundException e) { throw new UnsupportedOperationException("Invalid class reference provided", e); } } private  Utils(); }
Utils { static <T extends Type> String getTypeName(TypeReference<T> typeReference) { try { java.lang.reflect.Type reflectedType = typeReference.getType(); Class<?> type; if (reflectedType instanceof ParameterizedType) { type = (Class<?>) ((ParameterizedType) reflectedType).getRawType(); return getParameterizedTypeName(typeReference, type); } else { type = Class.forName(reflectedType.getTypeName()); return getSimpleTypeName(type); } } catch (ClassNotFoundException e) { throw new UnsupportedOperationException("Invalid class reference provided", e); } } private  Utils(); @SuppressWarnings("unchecked") static List<TypeReference<Type>> convert(List<TypeReference<?>> input); static List<R> typeMap(List<T> input, Class<R> destType); }
Utils { static <T extends Type> String getTypeName(TypeReference<T> typeReference) { try { java.lang.reflect.Type reflectedType = typeReference.getType(); Class<?> type; if (reflectedType instanceof ParameterizedType) { type = (Class<?>) ((ParameterizedType) reflectedType).getRawType(); return getParameterizedTypeName(typeReference, type); } else { type = Class.forName(reflectedType.getTypeName()); return getSimpleTypeName(type); } } catch (ClassNotFoundException e) { throw new UnsupportedOperationException("Invalid class reference provided", e); } } private  Utils(); @SuppressWarnings("unchecked") static List<TypeReference<Type>> convert(List<TypeReference<?>> input); static List<R> typeMap(List<T> input, Class<R> destType);  }