HashMap.PutIfAbsent(Object, Object) 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.
Stores a value when the key is absent or currently maps to null.
[Android.Runtime.Register("putIfAbsent", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "GetPutIfAbsent_Ljava_lang_Object_Ljava_lang_Object_Handler", ApiSince=26)]
public virtual Java.Lang.Object? PutIfAbsent(Java.Lang.Object? key, Java.Lang.Object? value);
[<Android.Runtime.Register("putIfAbsent", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "GetPutIfAbsent_Ljava_lang_Object_Ljava_lang_Object_Handler", ApiSince=26)>]
abstract member PutIfAbsent : Java.Lang.Object * Java.Lang.Object -> Java.Lang.Object
override this.PutIfAbsent : Java.Lang.Object * Java.Lang.Object -> Java.Lang.Object
Parameters
- key
- Object
The key for the proposed mapping.
- value
- Object
The value to store if no non-null value is mapped to the key.
Returns
The previous value, or null if the key was absent or mapped to null.
Implements
- Attributes
Remarks
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.