public static String describe(Type t) { if (t instanceof Class<?>) { return Descriptor.of(((Class) t).getName()); } else if (t instanceof ParameterizedType) { ParameterizedType pType = ((ParameterizedType) t); Type[] args = pType.getActualTypeArguments(); StringBuilder formatted = new StringBuilder(); for (Type type : args) { formatted.append(describe(type)); } return parameterized((Class) pType.getRawType()).ofFormatted(formatted.toString()).build(); } return ""; }
public static ClassNameBuilder parameterized(Class<?> clazz) { return new ClassNameBuilder(Descriptor.of(clazz.getName())); }
ClassNameBuilder of(Class<?> clazz) { return new ClassNameBuilder(prune(this.name) + "<" + Descriptor.of(clazz.getName()) + ">;"); }