Interface Processor<T>

  • All Superinterfaces:
    java.lang.AutoCloseable, java.lang.Cloneable, Reference<T>, org.comroid.api.SelfDeclared<Reference<T>>, org.comroid.api.Specifiable<Reference<T>>, java.util.function.Supplier<T>

    public interface Processor<T>
    extends Reference<T>, java.lang.Cloneable, java.lang.AutoCloseable
    Cloneable through process().
    • Method Detail

      • isPresent

        default boolean isPresent()
      • ofOptional

        static <T> Processor<T> ofOptional​(java.util.Optional<T> optional)
      • ofConstant

        static <T> Processor<T> ofConstant​(T value)
      • providedOptional

        static <T> Processor<T> providedOptional​(java.util.function.Supplier<java.util.Optional<T>> supplier)
      • get

        @Nullable
        T get()
        Specified by:
        get in interface Reference<T>
        Specified by:
        get in interface java.util.function.Supplier<T>
      • close

        default void close()
        Consumes the processor and terminates. Used for completing some calls that return processors.
        Specified by:
        close in interface java.lang.AutoCloseable
      • filter

        default Processor<T> filter​(java.util.function.Predicate<? super T> predicate)
      • map

        default <R> Processor<R> map​(java.util.function.Function<? super T,​? extends R> mapper)
      • peek

        default Processor<T> peek​(java.util.function.Consumer<? super T> action)
      • flatMap

        default <R> Processor<R> flatMap​(java.util.function.Function<? super T,​? extends Reference<R>> mapper)