Share via


IJavaPeerable.PeerReference Property

Definition

Returns a JniObjectReference of the wrapped Java object instance.

public Java.Interop.JniObjectReference PeerReference { get; }
member this.PeerReference : Java.Interop.JniObjectReference

Property Value

Remarks

<block subset="none" type="usage"> This property will not throw a ObjectDisposedException after the instance has been disposed. </block> <block subset="none" type="note">

THIS VALUE WILL CHANGE OVER TIME. It is NOT stable. It may potentially change during any future GC. DO NOT use this value as a key in a dictionary. The JniIdentityHashCode property may be used for that purpose.

While the value can change, the PeerReference property should always refer to the same Java instance. (Multiple different JNI handle values may refer to the same Java instance.)

</block> <block subset="none" type="overrides"> The JniIdentityHashCode property should return the value last passed to Java.Interop.IJavaPeerable.SetJniIdentityHashCode. </block>

Applies to

See also

  • <xref:Java.Interop.IJavaPeerable.SetPeerReference>