Package org.reflections.util
Interface QueryFunction<C,T>
-
- All Superinterfaces:
Function<C,Set<T>>
,NameHelper
public interface QueryFunction<C,T> extends Function<C,Set<T>>, NameHelper
sam function for store queryapply(C) -> Set<T>
QueryFunction<T> query = ctx -> ctx.get(key)
supports functional composition
filter(Predicate)
,map(Function)
,flatMap(Function)
, ...
-
-
Field Summary
-
Fields inherited from interface org.reflections.util.NameHelper
primitiveDescriptors, primitiveNames, primitiveTypes
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <R> QueryFunction<C,T>
add(QueryFunction<C,T> function)
concat elements from functionSet<T>
apply(C ctx)
default <R> QueryFunction<C,Class<? extends R>>
as()
cast elements as<R>
unsafedefault <R> QueryFunction<C,R>
as(Class<? extends R> type, ClassLoader... loaders)
convert to giventype
, usesNameHelper.forName(java.lang.String, java.lang.Class, java.lang.ClassLoader...)
default <R> QueryFunction<C,Class<?>>
asClass(ClassLoader... loaders)
convert elements toClass
usingNameHelper.forName(java.lang.String, java.lang.Class, java.lang.ClassLoader...)
default QueryFunction<C,String>
asString()
convert elements to String usingNameHelper.toName(AnnotatedElement)
static <C,T>
QueryFunction<Store,T>empty()
default QueryFunction<C,T>
filter(Predicate<? super T> predicate)
filter by predicatedefault <R> QueryFunction<C,R>
flatMap(Function<T,? extends Function<C,Set<R>>> function)
flatmap by functiondefault <R> QueryFunction<C,R>
getAll(Function<T,QueryFunction<C,R>> builder, Function<R,T> traverse)
transitively get all bybuilder
default QueryFunction<C,T>
getAll(Function<T,QueryFunction<C,T>> builder)
transitively get all bybuilder
default <R> QueryFunction<C,R>
map(Function<? super T,? extends R> function)
map by functionstatic <C,T>
QueryFunction<Store,T>set(Collection<T> elements)
static <C,T>
QueryFunction<Store,T>single(T element)
-
-
-
Method Detail
-
empty
static <C,T> QueryFunction<Store,T> empty()
-
single
static <C,T> QueryFunction<Store,T> single(T element)
-
set
static <C,T> QueryFunction<Store,T> set(Collection<T> elements)
-
filter
default QueryFunction<C,T> filter(Predicate<? super T> predicate)
filter by predicateSubTypes.of(type).filter(withPrefix("org"))
-
map
default <R> QueryFunction<C,R> map(Function<? super T,? extends R> function)
map by functionTypesAnnotated.with(annotation).asClass().map(Annotation::annotationType)
-
flatMap
default <R> QueryFunction<C,R> flatMap(Function<T,? extends Function<C,Set<R>>> function)
flatmap by functionQueryFunction<Method> methods = SubTypes.of(type).asClass().flatMap(Methods::of)
-
getAll
default QueryFunction<C,T> getAll(Function<T,QueryFunction<C,T>> builder)
transitively get all bybuilder
SuperTypes.of(type).getAll(Annotations::get)
-
getAll
default <R> QueryFunction<C,R> getAll(Function<T,QueryFunction<C,R>> builder, Function<R,T> traverse)
transitively get all bybuilder
SuperTypes.of(type).getAll(Annotations::get)
-
add
default <R> QueryFunction<C,T> add(QueryFunction<C,T> function)
concat elements from functionAnnotations.of(method).add(Annotations.of(type))
-
as
default <R> QueryFunction<C,R> as(Class<? extends R> type, ClassLoader... loaders)
convert to giventype
, usesNameHelper.forName(java.lang.String, java.lang.Class, java.lang.ClassLoader...)
Methods.of(type).as(Method.class)
-
asClass
default <R> QueryFunction<C,Class<?>> asClass(ClassLoader... loaders)
convert elements toClass
usingNameHelper.forName(java.lang.String, java.lang.Class, java.lang.ClassLoader...)
SubTypes.of(type).asClass()
-
asString
default QueryFunction<C,String> asString()
convert elements to String usingNameHelper.toName(AnnotatedElement)
-
as
default <R> QueryFunction<C,Class<? extends R>> as()
cast elements as<R>
unsafe
-
-