Class LazyEvaluator<T>

java.lang.Object
io.sentry.util.LazyEvaluator<T>

@Internal public final class LazyEvaluator<T> extends Object
Class that evaluates a function lazily. It means the evaluator function is called only when getValue is called, and it's cached.
  • Constructor Details

    • LazyEvaluator

      public LazyEvaluator(@NotNull @NotNull LazyEvaluator.Evaluator<T> evaluator)
      Class that evaluates a function lazily. It means the evaluator function is called only when getValue is called, and it's cached.
      Parameters:
      evaluator - The function to evaluate.
  • Method Details

    • getValue

      @NotNull public T getValue()
      Executes the evaluator function and caches its result, so that it's called only once.
      Returns:
      The result of the evaluator function.