public interface QueryFunction<C,T> extends Function<C,Set<T>>, NameHelper
apply(C) -> Set<T>
QueryFunction<T> query = ctx -> ctx.get(key)
supports functional composition filter(Predicate)
, map(Function)
, flatMap(Function)
, ...
primitiveDescriptors, primitiveNames, primitiveTypes
Modifier and Type | Method and Description |
---|---|
default <R> QueryFunction<C,T> |
add(QueryFunction<C,T> function)
concat elements from function
|
Set<T> |
apply(C ctx) |
default <R> QueryFunction<C,Class<? extends R>> |
as()
cast elements as
<R> unsafe |
default <R> QueryFunction<C,R> |
as(Class<? extends R> type,
ClassLoader... loaders)
convert to given
type , uses NameHelper.forName(java.lang.String, java.lang.Class, java.lang.ClassLoader...) |
default <R> QueryFunction<C,Class<?>> |
asClass(ClassLoader... loaders)
convert elements to
Class using NameHelper.forName(java.lang.String, java.lang.Class, java.lang.ClassLoader...) |
default QueryFunction<C,String> |
asString()
convert elements to String using
NameHelper.toName(AnnotatedElement) |
static <C,T> QueryFunction<Store,T> |
empty() |
default QueryFunction<C,T> |
filter(Predicate<? super T> predicate)
filter by predicate
|
default <R> QueryFunction<C,R> |
flatMap(Function<T,? extends Function<C,Set<R>>> function)
flatmap by function
|
default <R> QueryFunction<C,R> |
getAll(Function<T,QueryFunction<C,R>> builder,
Function<R,T> traverse)
transitively get all by
builder |
default QueryFunction<C,T> |
getAll(Function<T,QueryFunction<C,T>> builder)
transitively get all by
builder |
default <R> QueryFunction<C,R> |
map(Function<? super T,? extends R> function)
map by function
|
static <C,T> QueryFunction<Store,T> |
set(Collection<T> elements) |
static <C,T> QueryFunction<Store,T> |
single(T element) |
static <C,T> QueryFunction<Store,T> empty()
static <C,T> QueryFunction<Store,T> single(T element)
static <C,T> QueryFunction<Store,T> set(Collection<T> elements)
default QueryFunction<C,T> filter(Predicate<? super T> predicate)
SubTypes.of(type).filter(withPrefix("org"))
default <R> QueryFunction<C,R> map(Function<? super T,? extends R> function)
TypesAnnotated.with(annotation).asClass().map(Annotation::annotationType)
default <R> QueryFunction<C,R> flatMap(Function<T,? extends Function<C,Set<R>>> function)
QueryFunction<Method> methods = SubTypes.of(type).asClass().flatMap(Methods::of)
default QueryFunction<C,T> getAll(Function<T,QueryFunction<C,T>> builder)
builder
SuperTypes.of(type).getAll(Annotations::get)
default <R> QueryFunction<C,R> getAll(Function<T,QueryFunction<C,R>> builder, Function<R,T> traverse)
builder
SuperTypes.of(type).getAll(Annotations::get)
default <R> QueryFunction<C,T> add(QueryFunction<C,T> function)
Annotations.of(method).add(Annotations.of(type))
default <R> QueryFunction<C,R> as(Class<? extends R> type, ClassLoader... loaders)
type
, uses NameHelper.forName(java.lang.String, java.lang.Class, java.lang.ClassLoader...)
Methods.of(type).as(Method.class)
default <R> QueryFunction<C,Class<?>> asClass(ClassLoader... loaders)
Class
using NameHelper.forName(java.lang.String, java.lang.Class, java.lang.ClassLoader...)
SubTypes.of(type).asClass()
default QueryFunction<C,String> asString()
NameHelper.toName(AnnotatedElement)
default <R> QueryFunction<C,Class<? extends R>> as()
<R>
unsafeCopyright © 2021. All rights reserved.