Provider.PutIfAbsent(Object, Object) Method

Definition

If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value.

[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
value
Object

Returns

Attributes

Remarks

If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value.

If a security manager is enabled, its checkSecurityAccess method is called with the string "putProviderProperty."+name, where name is the provider name, to see if it's ok to set this provider's property values.

Added in 1.8.

Java documentation for java.security.Provider.putIfAbsent(java.lang.Object, 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