public class ReflectionUtilsPredicates extends Object
Constructor and Description |
---|
ReflectionUtilsPredicates() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isAssignable(Class[] childClasses,
Class[] parentClasses) |
static <T extends AnnotatedElement> |
withAnnotation(Annotation annotation)
where element is annotated with given
annotation , including member matching |
static <T extends AnnotatedElement> |
withAnnotation(Class<? extends Annotation> annotation)
where element is annotated with given
annotation |
static <T extends AnnotatedElement> |
withAnnotations(Annotation... annotations)
where element is annotated with given
annotations , including member matching |
static <T extends AnnotatedElement> |
withAnnotations(Class<? extends Annotation>... annotations)
where element is annotated with given
annotations |
static Predicate<Member> |
withAnyParameterAnnotation(Annotation annotation)
when method/constructor has any parameter with an annotation matches given
annotations , including member matching |
static Predicate<Member> |
withAnyParameterAnnotation(Class<? extends Annotation> annotationClass)
when method/constructor has any parameter with an annotation matches given
annotations |
static Predicate<Class<?>> |
withClassModifier(int mod)
when class modifier matches given
mod |
static <T extends Member> |
withInterface() |
static <T extends Member> |
withModifier(int mod)
when member modifier matches given
mod |
static <T extends Member> |
withName(String name)
where member name equals given
name |
static <T> Predicate<T> |
withNamePrefix(String prefix)
where annotated element name startsWith given
prefix |
static Predicate<Member> |
withParameters(Class<?>... types)
when method/constructor parameter types equals given
types |
static Predicate<Member> |
withParametersAssignableFrom(Class... types)
when method/constructor parameter types assignable from given
types |
static Predicate<Member> |
withParametersAssignableTo(Class... types)
when member parameter types assignable to given
types |
static Predicate<Member> |
withParametersCount(int count)
when method/constructor parameters count equal given
count |
static <T extends AnnotatedElement> |
withPattern(String regex)
where member's
toString matches given regex |
static <T extends Member> |
withPrefix(String prefix)
where member name startsWith given
prefix |
static <T extends Member> |
withPublic()
when member modifier is public
|
static <T> Predicate<Method> |
withReturnType(Class<T> type)
when method return type equal given
type |
static <T> Predicate<Method> |
withReturnTypeAssignableFrom(Class<T> type)
when method return type assignable from given
type |
static <T extends Member> |
withStatic() |
static <T> Predicate<Field> |
withType(Class<T> type)
when field type equal given
type |
static <T> Predicate<Field> |
withTypeAssignableTo(Class<T> type)
when field type assignable to given
type |
public static <T extends Member> Predicate<T> withName(String name)
name
public static <T extends Member> Predicate<T> withPrefix(String prefix)
prefix
public static <T> Predicate<T> withNamePrefix(String prefix)
prefix
public static <T extends AnnotatedElement> Predicate<T> withPattern(String regex)
toString
matches given regex
get(Methods.of(someClass).filter(withPattern("public void .*")))
public static <T extends AnnotatedElement> Predicate<T> withAnnotation(Class<? extends Annotation> annotation)
annotation
public static <T extends AnnotatedElement> Predicate<T> withAnnotations(Class<? extends Annotation>... annotations)
annotations
public static <T extends AnnotatedElement> Predicate<T> withAnnotation(Annotation annotation)
annotation
, including member matchingpublic static <T extends AnnotatedElement> Predicate<T> withAnnotations(Annotation... annotations)
annotations
, including member matchingpublic static Predicate<Member> withParameters(Class<?>... types)
types
public static Predicate<Member> withParametersAssignableTo(Class... types)
types
public static Predicate<Member> withParametersAssignableFrom(Class... types)
types
public static Predicate<Member> withParametersCount(int count)
count
public static Predicate<Member> withAnyParameterAnnotation(Class<? extends Annotation> annotationClass)
annotations
public static Predicate<Member> withAnyParameterAnnotation(Annotation annotation)
annotations
, including member matchingpublic static <T> Predicate<Field> withType(Class<T> type)
type
public static <T> Predicate<Field> withTypeAssignableTo(Class<T> type)
type
public static <T> Predicate<Method> withReturnType(Class<T> type)
type
public static <T> Predicate<Method> withReturnTypeAssignableFrom(Class<T> type)
type
public static <T extends Member> Predicate<T> withModifier(int mod)
mod
for example:
withModifier(Modifier.PUBLIC)
public static <T extends Member> Predicate<T> withPublic()
public static Predicate<Class<?>> withClassModifier(int mod)
mod
for example:
withModifier(Modifier.PUBLIC)
Copyright © 2021. All rights reserved.