@Test public void testIsAClassOrInterface() { assertTrue(ClassUtil.isA(String.class, Object.class)); assertTrue(ClassUtil.isA(Integer.class, Number.class)); assertTrue(ClassUtil.isA(NullPointerException.class, Exception.class)); assertTrue(ClassUtil.isA(ArrayList.class, AbstractCollection.class)); assertFalse(ClassUtil.isA(Object.class, String.class)); }
public static boolean isA(Class<?> what, Class<?> interfaceOrSuper) { return interfaceOrSuper.isAssignableFrom(what); }
ClassUtil { public static boolean isA(Class<?> what, Class<?> interfaceOrSuper) { return interfaceOrSuper.isAssignableFrom(what); } }
ClassUtil { public static boolean isA(Class<?> what, Class<?> interfaceOrSuper) { return interfaceOrSuper.isAssignableFrom(what); } private  ClassUtil(); }
ClassUtil { public static boolean isA(Class<?> what, Class<?> interfaceOrSuper) { return interfaceOrSuper.isAssignableFrom(what); } private  ClassUtil(); static boolean isA(Class<?> what, Class<?> interfaceOrSuper); static boolean isA(Object what, Class<?> interfaceOrSuper); static boolean isPrimitiveNumber(Object obj); static boolean isPrimitiveNumber(Class<?> c); static boolean isNumber(Object obj); static boolean isNumber(Class<?> c); static boolean isNumeric(Object obj); static boolean isWrapper(Class<?> cls); }
ClassUtil { public static boolean isA(Class<?> what, Class<?> interfaceOrSuper) { return interfaceOrSuper.isAssignableFrom(what); } private  ClassUtil(); static boolean isA(Class<?> what, Class<?> interfaceOrSuper); static boolean isA(Object what, Class<?> interfaceOrSuper); static boolean isPrimitiveNumber(Object obj); static boolean isPrimitiveNumber(Class<?> c); static boolean isNumber(Object obj); static boolean isNumber(Class<?> c); static boolean isNumeric(Object obj); static boolean isWrapper(Class<?> cls);  }