Interface Transformation<T>

  • Type Parameters:
    T - The type of state to be transformed in a chain
    All Superinterfaces:
    java.util.function.Function<java.util.function.Supplier<T>,​Arbitrary<Transformer<T>>>
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    @API(status=EXPERIMENTAL,
         since="1.7.0")
    public interface Transformation<T>
    extends java.util.function.Function<java.util.function.Supplier<T>,​Arbitrary<Transformer<T>>>
    A transformation provides an arbitrary of transformers for values of type T in the context of chains. The provided arbitrary of transformers can depend on the previous state, which can be retrieved using the first supplier argument of the function. A transformation can also be restricted by a precondition, which must hold for the transformation to be applicable.
    See Also:
    Chain, Transformer
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  Transformation.Builder<T>  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.function.Predicate<?> NO_PRECONDITION  
    • Method Summary

      All Methods Static Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default java.util.function.Predicate<T> precondition()
      Override this method if the applicability of the provided transformers depends on the previous state
      static <T> Transformation.Builder<T> when​(java.util.function.Predicate<T> precondition)
      Create a TransformerProvider with a precondition
      • Methods inherited from interface java.util.function.Function

        andThen, apply, compose
    • Field Detail

      • NO_PRECONDITION

        static final java.util.function.Predicate<?> NO_PRECONDITION
    • Method Detail

      • when

        static <T> Transformation.Builder<T> when​(java.util.function.Predicate<T> precondition)
        Create a TransformerProvider with a precondition
      • precondition

        default java.util.function.Predicate<T> precondition()
        Override this method if the applicability of the provided transformers depends on the previous state
        Returns:
        a predicate with input T