IAnnotation.Equals(Object) Method

Definition

Returns true if the specified object represents an annotation that is logically equivalent to this one.

[Android.Runtime.Register("equals", "(Ljava/lang/Object;)Z", "GetEquals_Ljava_lang_Object_Handler:Java.Lang.Annotation.IAnnotationInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool Equals (Java.Lang.Object? obj);
[<Android.Runtime.Register("equals", "(Ljava/lang/Object;)Z", "GetEquals_Ljava_lang_Object_Handler:Java.Lang.Annotation.IAnnotationInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Equals : Java.Lang.Object -> bool

Parameters

obj
Object

The object to compare to.

Returns

true if the specified object represents an annotation that is logically equivalent to this one, otherwise false

Attributes

Remarks

Returns true if the specified object represents an annotation that is logically equivalent to this one. In other words, returns true if the specified object is an instance of the same annotation interface as this instance, all of whose members are equal to the corresponding member of this annotation, as defined below: <ul> <li>Two corresponding primitive typed members whose values are x and y are considered equal if x == y, unless their type is float or double.

<li>Two corresponding float members whose values are x and y are considered equal if Float.valueOf(x).equals(Float.valueOf(y)). (Unlike the == operator, NaN is considered equal to itself, and 0.0f unequal to -0.0f.)

<li>Two corresponding double members whose values are x and y are considered equal if Double.valueOf(x).equals(Double.valueOf(y)). (Unlike the == operator, NaN is considered equal to itself, and 0.0 unequal to -0.0.)

<li>Two corresponding String, Class, enum, or annotation typed members whose values are x and y are considered equal if x.equals(y). (Note that this definition is recursive for annotation typed members.)

<li>Two corresponding array typed members x and y are considered equal if Arrays.equals(x, y), for the appropriate overloading of java.util.Arrays#equals Arrays.equals. </ul>

Java documentation for java.lang.annotation.Annotation.equals(java.lang.Object).

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