TypeMatcher

public interface TypeMatcher implements Predicate<T>

Tells if a passed class satisfies some particular criterion.

Functions

Link copied to clipboard
public static Class<? extends Message> asMessageType(Class<? extends Object> cls)
Link copied to clipboard
public static TypeMatcher classImplementing(Class<? extends Object> iface)
Creates a type matcher which matches the type if it is a class (i.e.
Link copied to clipboard
public static boolean differs(TypeToken<?> type, TypeToken<?> expectedSuper)
Tells whether the type is not the same nor a descendant as expectedSuper.
Link copied to clipboard
public static TypeMatcher exactly(Class<? extends Object> type)
Creates a type matcher which matches the type is equal to the passed type.
Link copied to clipboard
public static Array<TypeVariable<? extends Class<? extends Object>>> genericTypesOf(TypeToken<?> type)
Link copied to clipboard
public static boolean matchActualGenericsToOne(TypeToken<?> whoseGenerics, TypeToken<?> expectedGenericType)
Link copied to clipboard
public static boolean matches(TypeToken<?> expected, TypeToken<?> actual)
Tells whether the actual type matches the expected.
Link copied to clipboard
public static boolean matchOneToOne(TypeToken<?> expected, TypeToken<?> actual)
Link copied to clipboard
public static ImmutableSet<Class<? extends Message>> messagesFitting(TypeToken<?> type)
Returns a set of Message types that are declared by the given type.
Link copied to clipboard
public static TypeToken<?> resolve(TypeToken<?> type, TypeVariable<? extends Class<? extends Object>> param)
Resolves the generic parameter of the passed type into an actual value.

Inherited functions

Link copied to clipboard
public Predicate<T> and(Predicate<? extends Object> other)
Link copied to clipboard
public static Predicate<T> isEqual<T>(Object targetRef)
Link copied to clipboard
public Predicate<T> negate()
Link copied to clipboard
public static Predicate<T> not<T>(Predicate<? extends Object> target)
Link copied to clipboard
public Predicate<T> or(Predicate<? extends Object> other)
Link copied to clipboard
public abstract boolean test(T p)