Interface JsLazy

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface JsLazy
Marker for a lazily-resolved binding value. When stored as a binding's value, the engine invokes get() on each read instead of returning the binding object itself.

Use this — not java.util.function.Supplier — to register lazy properties (e.g. mock-server request*, scenario-scoped session accessors). Supplier is a generic functional interface that any callable host object (including JS functions via JavaCallable) can satisfy, which would conflate "this is a value to compute lazily" with "this is a callable somebody passed in."

  • Method Summary

    Modifier and Type
    Method
    Description
    get()
     
  • Method Details