Freigeben über


IWrapper.IsWrapperFor(Class) Method

Definition

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.

[Android.Runtime.Register("isWrapperFor", "(Ljava/lang/Class;)Z", "GetIsWrapperFor_Ljava_lang_Class_Handler:Java.Sql.IWrapperInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool IsWrapperFor (Java.Lang.Class? iface);
[<Android.Runtime.Register("isWrapperFor", "(Ljava/lang/Class;)Z", "GetIsWrapperFor_Ljava_lang_Class_Handler:Java.Sql.IWrapperInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member IsWrapperFor : Java.Lang.Class -> bool

Parameters

iface
Class

a Class defining an interface.

Returns

true if this implements the interface or directly or indirectly wraps an object that does.

Attributes

Remarks

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively calling isWrapperFor on the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared to unwrap so that callers can use this method to avoid expensive unwrap calls that may fail. If this method returns true then calling unwrap with the same argument should succeed.

Added in 1.6.

Java documentation for java.sql.Wrapper.isWrapperFor(java.lang.Class<?>).

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