Package io.sentry.util
Class LazyEvaluator<T>
java.lang.Object
io.sentry.util.LazyEvaluator<T>
Class that evaluates a function lazily. It means the evaluator function is called only when
getValue is called, and it's cached.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionLazyEvaluator
(@NotNull LazyEvaluator.Evaluator<T> evaluator) Class that evaluates a function lazily. -
Method Summary
-
Constructor Details
-
LazyEvaluator
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
Executes the evaluator function and caches its result, so that it's called only once.- Returns:
- The result of the evaluator function.
-