Provider.ComputeIfAbsent(Object, IFunction) 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.
If the specified key is not already associated with a value (or
is mapped to null
), attempts to compute its value using
the given mapping function and enters it into this map unless
null
.
[Android.Runtime.Register("computeIfAbsent", "(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;", "GetComputeIfAbsent_Ljava_lang_Object_Ljava_util_function_Function_Handler", ApiSince=26)]
public virtual Java.Lang.Object? ComputeIfAbsent (Java.Lang.Object? key, Java.Util.Functions.IFunction? mappingFunction);
[<Android.Runtime.Register("computeIfAbsent", "(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;", "GetComputeIfAbsent_Ljava_lang_Object_Ljava_util_function_Function_Handler", ApiSince=26)>]
abstract member ComputeIfAbsent : Java.Lang.Object * Java.Util.Functions.IFunction -> Java.Lang.Object
override this.ComputeIfAbsent : Java.Lang.Object * Java.Util.Functions.IFunction -> Java.Lang.Object
Parameters
- key
- Object
- mappingFunction
- IFunction
Returns
- Attributes
Remarks
If the specified key is not already associated with a value (or is mapped to null
), attempts to compute its value using the given mapping function and enters it into this map unless null
.
If a security manager is enabled, its checkSecurityAccess
method is called with the strings "putProviderProperty."+name
and "removeProviderProperty."+name
, where name
is the provider name, to see if it's ok to set this provider's property values and remove this provider's properties.
Added in 1.8.
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.