MethodHandles#guardWithTest(MethodHandle, MethodHandle, MethodHandle)
and for adjusting their method types.
| Modifier and Type | Field and Description |
|---|---|
| private static final MethodHandle | |
| private static final MethodHandle | |
| private static final MethodHandle | |
| private static final MethodHandle | |
| private static final MethodHandle | |
| private static final MethodHandle | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static MethodHandle | Returns: the adapted method handlethe test method handle test, final MethodType the type to adapt the method handle to type)Takes a method handle intended to be used as a guard, and adapts it to the requested type, but returning a boolean. |
| public static MethodHandle | Returns: the adapted method handlethe linker services to use for type conversions linkerServices, final MethodHandle the test method handle test, final MethodType the type to adapt the method handle to type)Takes a method handle intended to be used as a guard, and adapts it to the requested type, but returning a boolean. |
| private static MethodHandle | |
| private static MethodHandle | |
| private static MethodHandle | |
| private static MethodHandle | |
| private static MethodHandle | getClassBoundArgumentTest(final MethodHandle test, final Class<?> clazz, final int pos, final MethodType type)
|
| public static MethodHandle | Returns: the desired guard method.the class to test for. clazz)Creates a guard method that tests its only argument for being of an exact particular class. |
| public static MethodHandle | Returns: the desired guard method.the object used as referential identity test obj)Creates a guard method that tests its only argument for being referentially identical to another object |
| public static MethodHandle | Returns: the desired guard method.the class to test for. clazz)Creates a guard method that tests its only argument for being an instance of a particular class. |
| private static MethodType | |
| public static MethodHandle | Returns: a method handle that returns true if the argument in the specified position is a Java array; the rest of the arguments are ignored.the position in the argument lit pos, final MethodType the method type of the handle type)Creates a method handle that returns true if the argument in the specified position is a Java array. |
| private static boolean | |
| private static boolean | |
| public static MethodHandle | Returns: a method handle testing whether its first argument is of the specified class or subclass.the class of the first argument to test for clazz, final MethodType the method type type)Creates a method handle with arguments of a specified type, but with boolean return value. |
| public static MethodHandle | Returns: a method handle testing whether its first argument is of the specified class or subclass.the class of the first argument to test for clazz, final int the position on the argument list to test pos, final MethodType the method type type)Creates a method handle with arguments of a specified type, but with boolean return value. |
| public static MethodHandle | Returns: a guard that tests whether the first argument is not null.Returns a guard that tests whether the first argument is not null. |
| private static boolean | |
| public static MethodHandle | Returns: a guard that tests whether the first argument is null.Returns a guard that tests whether the first argument is null. |
| private static boolean | |
| public static MethodHandle | Returns: a method handle testing whether its first argument is of the specified class.the class of the first argument to test for clazz, final MethodType the method type type)Creates a guard method handle with arguments of a specified type, but with boolean return value. |
| private static boolean |
| IS_ARRAY | back to summary |
|---|---|
| private static final MethodHandle IS_ARRAY | |
| IS_IDENTICAL | back to summary |
|---|---|
| private static final MethodHandle IS_IDENTICAL | |
| IS_INSTANCE | back to summary |
|---|---|
| private static final MethodHandle IS_INSTANCE | |
| IS_NOT_NULL | back to summary |
|---|---|
| private static final MethodHandle IS_NOT_NULL | |
| IS_NULL | back to summary |
|---|---|
| private static final MethodHandle IS_NULL | |
| IS_OF_CLASS | back to summary |
|---|---|
| private static final MethodHandle IS_OF_CLASS | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| Guards | back to summary |
|---|---|
| private Guards() | |
| asType | back to summary |
|---|---|
| public static MethodHandle asType(final MethodHandle test, final MethodType type) Takes a method handle intended to be used as a guard, and adapts it to
the requested type, but returning a boolean. Applies
| |
| asType | back to summary |
|---|---|
| public static MethodHandle asType(final LinkerServices linkerServices, final MethodHandle test, final MethodType type) Takes a method handle intended to be used as a guard, and adapts it to
the requested type, but returning a boolean. Applies
| |
| asType | back to summary |
|---|---|
| private static MethodHandle asType(final MethodHandle test, final int pos, final MethodType type) | |
| constantBoolean | back to summary |
|---|---|
| private static MethodHandle constantBoolean(final Boolean value, final MethodType type) | |
| constantFalse | back to summary |
|---|---|
| private static MethodHandle constantFalse(final MethodType type) | |
| constantTrue | back to summary |
|---|---|
| private static MethodHandle constantTrue(final MethodType type) | |
| getClassBoundArgumentTest | back to summary |
|---|---|
| private static MethodHandle getClassBoundArgumentTest(final MethodHandle test, final Class<?> clazz, final int pos, final MethodType type) | |
| getClassGuard | back to summary |
|---|---|
| public static MethodHandle getClassGuard(final Class<?> clazz) Creates a guard method that tests its only argument for being of an exact particular class.
| |
| getIdentityGuard | back to summary |
|---|---|
| public static MethodHandle getIdentityGuard(final Object obj) Creates a guard method that tests its only argument for being referentially identical to another object
| |
| getInstanceOfGuard | back to summary |
|---|---|
| public static MethodHandle getInstanceOfGuard(final Class<?> clazz) Creates a guard method that tests its only argument for being an instance of a particular class.
| |
| getTestType | back to summary |
|---|---|
| private static MethodType getTestType(final MethodHandle test, final MethodType type) | |
| isArray | back to summary |
|---|---|
| public static MethodHandle isArray(final int pos, final MethodType type) Creates a method handle that returns true if the argument in the specified position is a Java array.
| |
| isArray | back to summary |
|---|---|
private static boolean isArray(final Object o)
| |
| isIdentical | back to summary |
|---|---|
private static boolean isIdentical(final Object o1, final Object o2)
| |
| isInstance | back to summary |
|---|---|
| public static MethodHandle isInstance(final Class<?> clazz, final MethodType type) Creates a method handle with arguments of a specified type, but with boolean return value. When invoked, it returns true if the first argument is instance of the specified class or its subclass). The rest of the arguments will be ignored.
| |
| isInstance | back to summary |
|---|---|
| public static MethodHandle isInstance(final Class<?> clazz, final int pos, final MethodType type) Creates a method handle with arguments of a specified type, but with boolean return value. When invoked, it returns true if the n'th argument is instance of the specified class or its subclass). The rest of the arguments will be ignored.
| |
| isNotNull | back to summary |
|---|---|
| public static MethodHandle isNotNull() Returns a guard that tests whether the first argument is not null.
| |
| isNotNull | back to summary |
|---|---|
private static boolean isNotNull(final Object obj)
| |
| isNull | back to summary |
|---|---|
| public static MethodHandle isNull() Returns a guard that tests whether the first argument is null.
| |
| isNull | back to summary |
|---|---|
private static boolean isNull(final Object obj)
| |
| isOfClass | back to summary |
|---|---|
| public static MethodHandle isOfClass(final Class<?> clazz, final MethodType type) Creates a guard method handle with arguments of a specified type, but with boolean return value. When invoked, it returns true if the first argument is of the specified class (exactly of it, not a subclass). The rest of the arguments will be ignored.
| |
| isOfClass | back to summary |
|---|---|
private static boolean isOfClass(final Class<?> c, final Object o)
| |