Interface QueryFunction<C,​T>

  • All Superinterfaces:
    java.util.function.Function<C,​java.util.Set<T>>, NameHelper

    public interface QueryFunction<C,​T>
    extends java.util.function.Function<C,​java.util.Set<T>>, NameHelper
    sam function for store query apply(C) -> Set<T>
    QueryFunction<T> query = ctx -> ctx.get(key) 

    supports functional composition filter(Predicate), map(Function), flatMap(Function), ...

    • Method Detail

      • apply

        java.util.Set<T> apply​(C ctx)
        Specified by:
        apply in interface java.util.function.Function<C,​T>
      • set

        static <C,​T> QueryFunction<Store,​T> set​(java.util.Collection<T> elements)
      • filter

        default QueryFunction<C,​T> filter​(java.util.function.Predicate<? super T> predicate)
        filter by predicate
        SubTypes.of(type).filter(withPrefix("org"))
      • map

        default <R> QueryFunction<C,​R> map​(java.util.function.Function<? super T,​? extends R> function)
        map by function
        TypesAnnotated.with(annotation).asClass().map(Annotation::annotationType)
      • flatMap

        default <R> QueryFunction<C,​R> flatMap​(java.util.function.Function<T,​? extends java.util.function.Function<C,​java.util.Set<R>>> function)
        flatmap by function
        QueryFunction<Method> methods = SubTypes.of(type).asClass().flatMap(Methods::of)
      • getAll

        default QueryFunction<C,​T> getAll​(java.util.function.Function<T,​QueryFunction<C,​T>> builder)
        transitively get all by builder
        SuperTypes.of(type).getAll(Annotations::get)
      • getAll

        default <R> QueryFunction<C,​R> getAll​(java.util.function.Function<T,​QueryFunction<C,​R>> builder,
                                                    java.util.function.Function<R,​T> traverse)
        transitively get all by builder
        SuperTypes.of(type).getAll(Annotations::get)
      • add

        default <R> QueryFunction<C,​T> add​(QueryFunction<C,​T> function)
        concat elements from function
        Annotations.of(method).add(Annotations.of(type))
      • as

        default <R> QueryFunction<C,​java.lang.Class<? extends R>> as()
        cast elements as <R> unsafe