Interface JavaCallable

All Superinterfaces:
Consumer<Object>, Function<Object,Object>, Predicate<Object>, Runnable, Supplier<Object>
All Known Subinterfaces:
JavaInvokable
All Known Implementing Classes:
JsFunction, JsFunctionWrapper

public interface JavaCallable extends Function<Object,Object>, Predicate<Object>, Consumer<Object>, Supplier<Object>, Runnable
  • Method Details

    • call

      Object call(Context context, Object... args)
      Override with varargs for external Java client convenience. Callers can use: callable.call(ctx, arg1, arg2)
    • isExternal

      default boolean isExternal()
    • apply

      default Object apply(Object t)
      Specified by:
      apply in interface Function<Object,Object>
    • test

      default boolean test(Object t)
      Specified by:
      test in interface Predicate<Object>
    • accept

      default void accept(Object t)
      Specified by:
      accept in interface Consumer<Object>
    • get

      default Object get()
      Specified by:
      get in interface Supplier<Object>
    • run

      default void run()
      Specified by:
      run in interface Runnable
    • isConstructable

      default boolean isConstructable()
      Whether this callable can be invoked with new. Default: false — only things that explicitly opt in (user-defined non-arrow functions, JsFunction subclasses, builtin constructor singletons, and the JsConstructor marker for Java-bridge types) report true. Used by the interpreter's construct path to throw a TypeError on new <non-constructor>(...) per spec.