Share via


IMapEntry.Equals(Object) Method

Definition

Compares the specified object with this entry for equality.

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

Parameters

o
Object

object to be compared for equality with this map entry

Returns

true if the specified object is equal to this map entry

Attributes

Remarks

Compares the specified object with this entry for equality. Returns true if the given object is also a map entry and the two entries represent the same mapping. More formally, two entries e1 and e2 represent the same mapping if

(e1.getKey()==null ?
                 e2.getKey()==null : e1.getKey().equals(e2.getKey()))  &amp;&amp;
                (e1.getValue()==null ?
                 e2.getValue()==null : e1.getValue().equals(e2.getValue()))

This ensures that the equals method works properly across different implementations of the Map.Entry interface.

Java documentation for java.util.Map.Entry.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

See also