public class UberClasses
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T> java.lang.Class<T> |
cast(java.lang.Class type)
Specified type is caster to requested type.
|
static boolean |
descends(java.lang.Class<?> a,
java.lang.Class<?> b)
Returns
true if 'a' descends from 'b'. |
static UberStream<java.lang.Class<?>> |
streamAncestors(java.lang.Class<?> type)
Stream of the type itself followed by all the ancestors
Use
Stream.skip(long) if you need to skip the type itself. |
static UberStream<java.lang.Class<?>> |
streamInterfaces(java.lang.Class<?> type)
Stream of the type itself followed by all the declared interfaces.
|
static UberStream<java.lang.Class<?>> |
streamTypeLinearization(java.lang.Class<?> type)
Stream of the type itself followed by interface-first linearization
of all its supertypes in order of declaration.
|
public static boolean descends(java.lang.Class<?> a,
java.lang.Class<?> b)
true if 'a' descends from 'b'.
Meaning that 'b' is assignable from 'a' and 'b' is not 'a'.public static UberStream<java.lang.Class<?>> streamAncestors(java.lang.Class<?> type)
Stream of the type itself followed by all the ancestors
Use Stream.skip(long) if you need to skip the type itself.
public static UberStream<java.lang.Class<?>> streamInterfaces(java.lang.Class<?> type)
Stream of the type itself followed by all the declared interfaces.
Use Stream.skip(long) if you need to skip the type itself.
public static UberStream<java.lang.Class<?>> streamTypeLinearization(java.lang.Class<?> type)
Stream of the type itself followed by interface-first linearization of all its supertypes in order of declaration.
Example:
interface I {}
interface I2 extends I {}
interface I3 extends I2 {}
class A implements I {}
class B extends A implements I3 {}
class C extends B implements I2 {}
linearization of I3 = [I3, I2, I]
linearization of A = [A, I]
linearization of B = [B, I3, I2, I, A]
linearization of C = [C, I2, I, B, I3, A]
public static <T> java.lang.Class<T> cast(java.lang.Class type)