/** * Get an {@link Iterable} that can iterate over a class hierarchy in ascending (subclass to superclass) order, * excluding interfaces. * * @param type the type to get the class hierarchy from * @return Iterable an Iterable over the class hierarchy of the given class * @since 3.2 */ public static Iterable<Class<?>> hierarchy(final Class<?> type) { return hierarchy(type, Interfaces.EXCLUDE); }
final Iterator<Class<?>> hierarchy = ClassUtils.hierarchy(declaringClass, interfacesBehavior).iterator();
LOG.info("Invalidating entity of type " + clazz.getName() + " with id " + id); for (Class<?> superclazz : ClassUtils.hierarchy(clazz)) { Cache cacheAnnotation = superclazz.getAnnotation(Cache.class); if (cacheAnnotation != null) {
@Test public void testHierarchyIncludingInterfaces() { final Iterator<Class<?>> iter = ClassUtils.hierarchy(StringParameterizedChild.class, Interfaces.INCLUDE).iterator(); assertEquals(StringParameterizedChild.class, iter.next()); assertEquals(GenericParent.class, iter.next()); assertEquals(GenericConsumer.class, iter.next()); assertEquals(Object.class, iter.next()); assertFalse(iter.hasNext()); }
@Test public void testHierarchyExcludingInterfaces() { final Iterator<Class<?>> iter = ClassUtils.hierarchy(StringParameterizedChild.class).iterator(); assertEquals(StringParameterizedChild.class, iter.next()); assertEquals(GenericParent.class, iter.next()); assertEquals(Object.class, iter.next()); assertFalse(iter.hasNext()); }
/** * Get an {@link Iterable} that can iterate over a class hierarchy in ascending (subclass to superclass) order, * excluding interfaces. * * @param type the type to get the class hierarchy from * @return Iterable an Iterable over the class hierarchy of the given class * @since 3.2 */ public static Iterable<Class<?>> hierarchy(final Class<?> type) { return hierarchy(type, Interfaces.EXCLUDE); }
/** * Get an {@link Iterable} that can iterate over a class hierarchy in ascending (subclass to superclass) order, * excluding interfaces. * * @param type the type to get the class hierarchy from * @return Iterable an Iterable over the class hierarchy of the given class * @since 3.2 */ public static Iterable<Class<?>> hierarchy(final Class<?> type) { return hierarchy(type, Interfaces.EXCLUDE); }
public EntityUUID(final URI entitySetURI, final Class<?> type, final Object key) { this.entitySetURI = entitySetURI; this.key = key; this.tempKey = (int) (Math.random() * 1000000); if (type == null || !Serializable.class.isAssignableFrom(type)) { throw new IllegalArgumentException("Invalid Entity type class: " + type); } if (this.type == null) { for (Class<?> clazz : ClassUtils.hierarchy(type, ClassUtils.Interfaces.INCLUDE)) { if (ArrayUtils.contains(clazz.getInterfaces(), EntityType.class)) { this.type = clazz; } } } }
public EntityUUID(final URI entitySetURI, final Class<?> type, final Object key) { this.entitySetURI = entitySetURI; this.key = key; this.tempKey = (int) (Math.random() * 1000000); if (type == null || !Serializable.class.isAssignableFrom(type)) { throw new IllegalArgumentException("Invalid Entity type class: " + type); } if (this.type == null) { for (Class<?> clazz : ClassUtils.hierarchy(type, ClassUtils.Interfaces.INCLUDE)) { if (ArrayUtils.contains(clazz.getInterfaces(), EntityType.class)) { this.type = clazz; } } } }
/** * Get an {@link Iterable} that can iterate over a class hierarchy in ascending (subclass to superclass) order, * excluding interfaces. * * @param type the type to get the class hierarchy from * @return Iterable an Iterable over the class hierarchy of the given class * @since 3.2 */ @GwtIncompatible("incompatible method") public static Iterable<Class<?>> hierarchy(final Class<?> type) { return hierarchy(type, Interfaces.EXCLUDE); }
Iterator<Class<?>> hierarchy = ClassUtils.hierarchy(declaringClass, ClassUtils.Interfaces.INCLUDE).iterator();
for (Class<?> hostClass : ClassUtils.hierarchy(host.getClass())) { try { Method addPrivilegedServiceMethod = hostClass.getMethod(
final Iterator<Class<?>> hierarchy = ClassUtils.hierarchy(declaringClass, interfacesBehavior).iterator();
final Iterator<Class<?>> hierarchy = ClassUtils.hierarchy(declaringClass, interfacesBehavior).iterator();
final Iterator<Class<?>> hierarchy = ClassUtils.hierarchy(declaringClass, interfacesBehavior).iterator();