Interface Argument
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
One argument of a
LazyScalarFunction call, not yet evaluated.
Calling value() evaluates the expression behind it; not calling it means
the expression never runs. The engine hands over arguments that remember their
result, so asking twice costs nothing and the function may read an argument wherever
it is convenient rather than caching it by hand.
Evaluation can fail — that is the point of deferring it — and the failure surfaces
from value() at the moment the function asks.
-
Method Details
-
value
Value value()Evaluates this argument, or returns the value already computed for it.- Returns:
- the argument's value; never
null
-
of
An argument that is already a value.- Parameters:
value- the value to hand over- Returns:
- an argument yielding
value
-
memoizing
An argument that runssupplierat most once, however often it is read.This is the shape the engine supplies, and the reason a lazy function can read the same argument in two branches without evaluating the expression twice.
- Parameters:
supplier- the deferred evaluation; called at most once- Returns:
- a remembering argument over
supplier
-