@Test public void testBoundOfParameterizedAttribute() throws NoSuchFieldException, NoSuchMethodException { final Class<?>[] g = null; final Class<?>[] s = new Class[] {Set.class}; final Class<ClassesTest> c = ClassesTest.class; assertNull(Classes.boundOfParameterizedAttribute(c.getMethod("getter0", g))); assertNull(Classes.boundOfParameterizedAttribute(c.getMethod("setter0", s))); assertEquals(Long .class, Classes.boundOfParameterizedAttribute(c.getField ("attrib2" ))); assertEquals(Integer.class, Classes.boundOfParameterizedAttribute(c.getMethod("getter1", g))); assertEquals(Byte .class, Classes.boundOfParameterizedAttribute(c.getMethod("getter2", g))); assertEquals(Object .class, Classes.boundOfParameterizedAttribute(c.getMethod("getter3", g))); assertEquals(String .class, Classes.boundOfParameterizedAttribute(c.getMethod("setter1", s))); assertEquals(Short .class, Classes.boundOfParameterizedAttribute(c.getMethod("setter2", s))); assertEquals(Object .class, Classes.boundOfParameterizedAttribute(c.getMethod("setter3", s))); }
public static Class<?> boundOfParameterizedAttribute(final Field field) { return getActualTypeArgument(field.getGenericType()); }
Classes { public static Class<?> boundOfParameterizedAttribute(final Field field) { return getActualTypeArgument(field.getGenericType()); } }
Classes { public static Class<?> boundOfParameterizedAttribute(final Field field) { return getActualTypeArgument(field.getGenericType()); } private  Classes(final Class<?> primitive, final Class<?> wrapper,
                    final boolean  isFloat,   final boolean  isInteger,
                    final byte     size,      final byte     ordinal); }
Classes { public static Class<?> boundOfParameterizedAttribute(final Field field) { return getActualTypeArgument(field.getGenericType()); } private  Classes(final Class<?> primitive, final Class<?> wrapper,
                    final boolean  isFloat,   final boolean  isInteger,
                    final byte     size,      final byte     ordinal); static Class<?> boundOfParameterizedAttribute(final Field field); static Class<?> boundOfParameterizedAttribute(final Method method); @SuppressWarnings("unchecked") static Class<? extends T> getClass(final T object); static Class<?> specializedClass(final Collection<?> objects); static Class<?> commonClass(final Collection<?> objects); static boolean sameInterfaces(final Class<? extends T> object1,
                                             final Class<? extends T> object2,
                                             final Class<T> base); static boolean isFloat(final Class<?> type); static boolean isInteger(final Class<?> type); static int getBitCount(final Class<?> type); static Class<?> primitiveToWrapper(final Class<?> type); static Class<?> wrapperToPrimitive(final Class<?> type); static byte getEnumConstant(final Class<?> type); @SuppressWarnings("unchecked") static T valueOf(final Class<T> type, final String value); static String getShortName(Class<?> classe); static String getShortClassName(final Object object); }
Classes { public static Class<?> boundOfParameterizedAttribute(final Field field) { return getActualTypeArgument(field.getGenericType()); } private  Classes(final Class<?> primitive, final Class<?> wrapper,
                    final boolean  isFloat,   final boolean  isInteger,
                    final byte     size,      final byte     ordinal); static Class<?> boundOfParameterizedAttribute(final Field field); static Class<?> boundOfParameterizedAttribute(final Method method); @SuppressWarnings("unchecked") static Class<? extends T> getClass(final T object); static Class<?> specializedClass(final Collection<?> objects); static Class<?> commonClass(final Collection<?> objects); static boolean sameInterfaces(final Class<? extends T> object1,
                                             final Class<? extends T> object2,
                                             final Class<T> base); static boolean isFloat(final Class<?> type); static boolean isInteger(final Class<?> type); static int getBitCount(final Class<?> type); static Class<?> primitiveToWrapper(final Class<?> type); static Class<?> wrapperToPrimitive(final Class<?> type); static byte getEnumConstant(final Class<?> type); @SuppressWarnings("unchecked") static T valueOf(final Class<T> type, final String value); static String getShortName(Class<?> classe); static String getShortClassName(final Object object); static final byte DOUBLE; }