Module jdk.dynalink

Class GuardedInvocation

java.lang.Object
jdk.dynalink.linker.GuardedInvocation

public class GuardedInvocation extends Object
Represents a conditionally valid method handle. Usually produced as a return value of GuardingDynamicLinker.getGuardedInvocation(LinkRequest, LinkerServices) and GuardingTypeConverterFactory.convertToType(Class, Class, Supplier). It is an immutable tuple of an invocation method handle, a guard method handle that defines the applicability of the invocation handle, zero or more switch points that can be used for external invalidation of the invocation handle, and an exception type that if thrown during an invocation of the method handle also invalidates it. The invocation handle is suitable for invocation if the guard handle returns true for its arguments, and as long as any of the switch points are not invalidated, and as long as it does not throw an exception of the designated type. The guard, the switch points, and the exception type are all optional (a guarded invocation having none of them is unconditionally valid).
Since:
9