GeezerVison is showing docs.oracle.com — MethodHandle (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
- Summary:
- Nested |
- Field |
- Constr |
- Method
- Detail:
- Field |
- Constr |
- Method
compact1, compact2, compact3
java.lang.invoke
Class MethodHandle
-
-
Method Summary
All Methods Instance Methods Concrete Methods
| Modifier and Type |
Method |
Description |
MethodHandle |
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.
|
MethodHandle |
asFixedArity() |
Makes a fixed arity method handle which is otherwise
equivalent to the current method handle.
|
MethodHandle |
asSpreader(Class<?> arrayType,
int arrayLength) |
Makes an array-spreading method handle, which accepts a trailing array argument
and spreads its elements as positional arguments.
|
MethodHandle |
asType(MethodType newType) |
Produces an adapter method handle which adapts the type of the
current method handle to a new type.
|
MethodHandle |
asVarargsCollector(Class<?> arrayType) |
Makes a variable arity adapter which is able to accept
any number of trailing positional arguments and collect them
into an array argument.
|
MethodHandle |
bindTo(Object x) |
Binds a value x to the first argument of a method handle, without invoking it.
|
Object |
invoke(Object... args) |
Invokes the method handle, allowing any caller type descriptor,
and optionally performing conversions on arguments and return values.
|
Object |
invokeExact(Object... args) |
Invokes the method handle, allowing any caller type descriptor, but requiring an exact type match.
|
Object |
invokeWithArguments(List<?> arguments) |
Performs a variable arity invocation, passing the arguments in the given array
to the method handle, as if via an inexact invoke from a call site
which mentions only the type Object, and whose arity is the length
of the argument array.
|
Object |
invokeWithArguments(Object... arguments) |
Performs a variable arity invocation, passing the arguments in the given list
to the method handle, as if via an inexact invoke from a call site
which mentions only the type Object, and whose arity is the length
of the argument list.
|
boolean |
isVarargsCollector() |
|
String |
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.
|
MethodType |
type() |
Reports the type of this method handle.
|
-
-
Method Detail
-
toString
public String 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.
In other words, this method returns a string equal to the value of:
"MethodHandle" + type().toString()
(Note: Future releases of this API may add further information
to the string representation.
Therefore, the present syntax should not be parsed by applications.)
- Overrides:
toString in class Object
- Returns:
- a string representation of the method handle
Java™ Platform Standard Ed. 8
- Summary:
- Nested |
- Field |
- Constr |
- Method
- Detail:
- Field |
- Constr |
- Method
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|