MethodHandles.ThrowException(Class, Class) Method

Definition

Produces a method handle which will throw exceptions of the given exType.

[Android.Runtime.Register("throwException", "(Ljava/lang/Class;Ljava/lang/Class;)Ljava/lang/invoke/MethodHandle;", "", ApiSince=26)]
public static Java.Lang.Invoke.MethodHandle? ThrowException (Java.Lang.Class? returnType, Java.Lang.Class? exType);
[<Android.Runtime.Register("throwException", "(Ljava/lang/Class;Ljava/lang/Class;)Ljava/lang/invoke/MethodHandle;", "", ApiSince=26)>]
static member ThrowException : Java.Lang.Class * Java.Lang.Class -> Java.Lang.Invoke.MethodHandle

Parameters

returnType
Class

the return type of the desired method handle

exType
Class

the parameter type of the desired method handle

Returns

MethodHandle

method handle which can throw the given exceptions

Attributes

Remarks

Java documentation for java.lang.invoke.MethodHandles.throwException(java.lang.Class<?>, java.lang.Class<? extends java.lang.Throwable>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to