Interface Pipe<T,U>

Type Parameters:
T - the type of the value to transform
U - the type of the value resulting from the transformation
All Superinterfaces:
Function<T,U>
All Known Subinterfaces:
PublisherPipe<T,U>, StreamPipe<T,U>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Pipe<T,U> extends Function<T,U>

A pipe is used within a template to transform a value before applying templates.

Pipes can be chained using the and(Pipe) method in order to apply multiple transformations.

Since:
1.2
Author:
Jeremy Kuhn
  • Method Summary

    Modifier and Type
    Method
    Description
    default <V> Pipe<T,V>
    and(Pipe<U,V> after)
    Chains the specified pipe after this pipe.
    static <T, U> U
    apply(T source, Pipe<T,U> pipe)
    Applies the specified pipe to the specified source value.

    Methods inherited from interface java.util.function.Function

    andThen, apply, compose
  • Method Details

    • and

      default <V> Pipe<T,V> and(Pipe<U,V> after)

      Chains the specified pipe after this pipe.

      Type Parameters:
      V - the type of the value returned by the resulting transformation
      Parameters:
      after - the pipe to chain after this pipe
      Returns:
      A pipe which first invokes this pipe and then the after pipe
    • apply

      static <T, U> U apply(T source, Pipe<T,U> pipe)

      Applies the specified pipe to the specified source value.

      Type Parameters:
      T - the type of the source value to transform
      U - the type of the value resulting from the transformation
      Parameters:
      source - the source value to transform
      pipe - the pipe to apply
      Returns:
      the transformed value