Class ResultOf<In,​DelegateIn,​Out>

  • All Implemented Interfaces:
    Quality<java.util.function.Function<java.util.function.Function<DelegateIn,​Out>,​java.util.function.Function<In,​Out>>>

    public final class ResultOf<In,​DelegateIn,​Out>
    extends java.lang.Object
    implements Quality<java.util.function.Function<java.util.function.Function<DelegateIn,​Out>,​java.util.function.Function<In,​Out>>>
    This quality can be used to isolate the logic of the outer function in a delegating function, which enables testing only the actual functions logic, not the logic of the delegate function.
     OuterFunction
     +-----------------------------------------------------------------------------------+
     |                      DelegateFunction                                             |
     |                     +------------------------------------------+                  |
     | OuterArgument ----> |  DelegateArgument -----> DelegateResult  | ---> OuterResult |
     |                     +------------------------------------------+                  |
     +-----------------------------------------------------------------------------------+
     
    Example:
     assertThat(delegate -> x -> delegate.apply(0) + 3,
         new ResultOf<Integer, Integer, Integer>(10, new Maps<>(0, 13))
     );
     
    • Constructor Summary

      Constructors 
      Constructor Description
      ResultOf​(Out delegateResult, Quality<? super java.util.function.Function<In,​Out>> delegate)
      Creates a new instance, with delegateResult being the result of the delegate inside the outer function, and a quality delegate for the result of the outer function.
    • Constructor Detail

      • ResultOf

        public ResultOf​(Out delegateResult,
                        Quality<? super java.util.function.Function<In,​Out>> delegate)
        Creates a new instance, with delegateResult being the result of the delegate inside the outer function, and a quality delegate for the result of the outer function.