MethodHandle (Java SE 26 & JDK 26)
- All Implemented Interfaces:
Constable
-
Method Summary
asCollector(int collectArgPos, Class<?> arrayType, int arrayLength) Makes an array-collecting method handle, which accepts a given number of positional arguments starting at a given position, and collects them into an array argument.
asCollector(Class<?> arrayType, int arrayLength) Makes an array-collecting method handle, which accepts a given number of trailing positional arguments and collects them into an array argument.
Makes a fixed arity method handle which is otherwise equivalent to the current method handle.
asSpreader(int spreadArgPos, Class<?> arrayType, int arrayLength) Makes an array-spreading method handle, which accepts an array argument at a given position and spreads its elements as positional arguments in place of the array.
asSpreader(Class<?> arrayType, int arrayLength) Makes an array-spreading method handle, which accepts a trailing array argument and spreads its elements as positional arguments.
Produces an adapter method handle which adapts the type of the current method handle to a new type.
Makes a variable arity adapter which is able to accept any number of trailing positional arguments and collect them into an array argument.
Binds a value
xto the first argument of a method handle, without invoking it.Return a nominal descriptor for this instance, if one can be constructed, or an empty
Optionalif one cannot be.Invokes the method handle, allowing any caller type descriptor, and optionally performing conversions on arguments and return values.
Invokes the method handle, allowing any caller type descriptor, but requiring an exact type match.
Performs a variable arity invocation, passing the arguments in the given array to the method handle, as if via an inexact
invokefrom a call site which mentions only the typeObject, and whose actual argument count is the length of the argument array.Performs a variable arity invocation, passing the arguments in the given list to the method handle, as if via an inexact
invokefrom a call site which mentions only the typeObject, and whose actual argument count is the length of the argument list.booleanDetermines if this method handle supports variable arity calls.
toString()Returns a string representation of the method handle, starting with the string
"MethodHandle"and ending with the string representation of the method handle's type.type()Reports the type of this method handle.
withVarargs(boolean makeVarargs) Adapts this method handle to be variable arity if the boolean flag is true, else fixed arity.
Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitCreates and returns a copy of this object.
booleanIndicates whether some other object is "equal to" this one.
protected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.intReturns a hash code value for this object.
final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Method Details
-
type
-
invokeExact
-
invoke
-
invokeWithArguments
-
invokeWithArguments
-
asType
-
asSpreader
-
asSpreader
-
withVarargs
-
asCollector
-
asCollector
-
asVarargsCollector
-
isVarargsCollector
-
asFixedArity
-
bindTo
-
describeConstable
-
toString
-