Class ScopedValueTracker.Snapshot

java.lang.Object
org.jdrupes.builder.core.ScopedValueTracker.Snapshot
Enclosing class:
ScopedValueTracker

public static final class ScopedValueTracker.Snapshot extends Object
A snapshot of the the values of the registered scoped value instances.
  • Method Details

    • withGet

      public <T> T withGet(Supplier<T> action)
      Get the value from the given supplier after restoring the values of the registered scoped value instances.
      Type Parameters:
      T - the generic type
      Parameters:
      action - the action
      Returns:
      the result
    • withCall

      public <T> T withCall(Callable<T> task) throws Exception
      Execute the given task after restoring the values of the registered scoped value instances.
      Type Parameters:
      T - the generic type
      Parameters:
      task - the action
      Returns:
      the result
      Throws:
      Exception