Class LazyResource<T>

java.lang.Object
org.saynotobugs.confidence.junit5.engine.resource.LazyResource<T>
All Implemented Interfaces:
org.dmfs.jems2.Fragile<ResourceHandle<T>,Exception>, Resource<T>

public final class LazyResource<T> extends Object implements Resource<T>
  • Constructor Details

    • LazyResource

      public LazyResource(org.dmfs.jems2.Fragile<T,Exception> resourceSource, org.dmfs.jems2.FragileProcedure<? super T,Exception> cleanUp)
      Constructor of a Resource that does not need a separate context.
    • LazyResource

      public LazyResource(org.dmfs.jems2.Fragile<Context,Exception> contextSource, org.dmfs.jems2.FragileFunction<? super Context,? extends T,Exception> contextToValueFunction, org.dmfs.jems2.FragileBiProcedure<? super T,? super Context,Exception> cleanUp)
      Constructor of a Resource that's created lazily from a given context. Use this constructor when more context than just the resource itself is needed to clean up after usage.
  • Method Details