List of usage examples for java.lang.reflect ParameterizedType getTypeName
default String getTypeName()
From source file:org.datalorax.populace.core.util.TypeUtils.java
/** * Returns an abbreviated generic name for logging purposes. Package names are abbreviated to a single character. * Generic info is included.//w w w .j a v a2 s.com * * @param type the type whose name should be abbreviated. * @return the abbreviated class name */ public static String abbreviatedName(final Type type) { if (type instanceof Class) { return abbreviatedName(((Class<?>) type).getName()); } if (type instanceof ParameterizedType) { final ParameterizedType pt = (ParameterizedType) type; return abbreviatedName(pt.getTypeName()); } throw new IllegalArgumentException("Type not supported: " + type); }