IAnnotation.GetHashCode Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the hash code of this annotation.
[Android.Runtime.Register("hashCode", "()I", "GetGetHashCodeHandler:Java.Lang.Annotation.IAnnotationInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public int GetHashCode ();
[<Android.Runtime.Register("hashCode", "()I", "GetGetHashCodeHandler:Java.Lang.Annotation.IAnnotationInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member GetHashCode : unit -> int
Returns
the hash code of this annotation
- Attributes
Remarks
Returns the hash code of this annotation.
The hash code of an annotation is the sum of the hash codes of its members (including those with default values).
The hash code of an annotation member is (127 times the hash code of the member-name as computed by String#hashCode()
) XOR the hash code of the member-value. The hash code of a member-value depends on its type as defined below: <ul> <li>The hash code of a primitive value v
is equal to <i>WrapperType</i>.valueOf(<i>v</i>).hashCode()
, where WrapperType
is the wrapper type corresponding to the primitive type of v
(Byte
, Character
, Double
, Float
, Integer
, Long
, Short
, or Boolean
).
<li>The hash code of a string, enum, class, or annotation member-value v
is computed as by calling <i>v</i>.hashCode()
. (In the case of annotation member values, this is a recursive definition.)
<li>The hash code of an array member-value is computed by calling the appropriate overloading of java.util.Arrays#hashCode(long[]) Arrays.hashCode
on the value. (There is one overloading for each primitive type, and one for object reference types.) </ul>
Java documentation for java.lang.annotation.Annotation.hashCode()
.
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.