Class Derived<Original,Derivate>

java.lang.Object
org.saynotobugs.confidence.junit5.engine.ResourceComposition<Derivate>
org.saynotobugs.confidence.junit5.engine.resource.Derived<Original,Derivate>
All Implemented Interfaces:
AutoCloseable, org.dmfs.jems2.Fragile<Derivate,RuntimeException>, org.dmfs.jems2.Single<Derivate>, Resource<Derivate>

public final class Derived<Original,Derivate> extends org.saynotobugs.confidence.junit5.engine.ResourceComposition<Derivate>
  • Constructor Details

    • Derived

      public Derived(org.dmfs.jems2.FragileFunction<? super Original,? extends Derivate,Exception> derivationFunction, Resource<? extends Original> delegate)
      Derivate of an existing Resource. The resource is derived by applying the given FragileFunction on the original Resource value.

      Use this constructor when the derived Resource does not need a separate clean-up procedure.

    • Derived

      public Derived(org.dmfs.jems2.FragileFunction<? super Original,? extends Derivate,Exception> derivationFunction, Resource<? extends Original> delegate, org.dmfs.jems2.FragileProcedure<Derivate,Exception> cleanUp)
      Derivate of an existing Resource. The resource is derived by applying the given FragileFunction on the original Resource value.

      The given clean-up procedure is executed when the resource is no longer needed.

      Note that, at present, the original resource might be closed before this one is cleaned-up. This might change in future versions.