Provider.Replace 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.
Overloads
| Name | Description |
|---|---|
| Replace(Object, Object) |
Replaces the entry for the specified key only if it is currently mapped to some value. |
| Replace(Object, Object, Object) |
Replaces the entry for the specified key only if currently mapped to the specified value. |
Replace(Object, Object)
Replaces the entry for the specified key only if it is currently mapped to some value.
[Android.Runtime.Register("replace", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "GetReplace_Ljava_lang_Object_Ljava_lang_Object_Handler", ApiSince=26)]
public override Java.Lang.Object? Replace(Java.Lang.Object? key, Java.Lang.Object? value);
[<Android.Runtime.Register("replace", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "GetReplace_Ljava_lang_Object_Ljava_lang_Object_Handler", ApiSince=26)>]
override this.Replace : Java.Lang.Object * Java.Lang.Object -> Java.Lang.Object
Parameters
- key
- Object
the key with which the specified value is to be associated.
- value
- Object
the value to replace the existing value.
Returns
the previous value associated with the specified key, or null if there was no mapping.
- Attributes
Remarks
Replaces the entry for the specified key only if it is currently mapped to some 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.replace(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
Replace(Object, Object, Object)
Replaces the entry for the specified key only if currently mapped to the specified value.
[Android.Runtime.Register("replace", "(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z", "GetReplace_Ljava_lang_Object_Ljava_lang_Object_Ljava_lang_Object_Handler", ApiSince=26)]
public override bool Replace(Java.Lang.Object? key, Java.Lang.Object? oldValue, Java.Lang.Object? newValue);
[<Android.Runtime.Register("replace", "(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z", "GetReplace_Ljava_lang_Object_Ljava_lang_Object_Ljava_lang_Object_Handler", ApiSince=26)>]
override this.Replace : Java.Lang.Object * Java.Lang.Object * Java.Lang.Object -> bool
Parameters
- key
- Object
the key with which the specified value is associated.
- oldValue
- Object
the value expected to be associated with the specified key.
- newValue
- Object
the value to be associated with the specified key.
Returns
true if the value was replaced.
- Attributes
Remarks
Replaces the entry for the specified key only if currently mapped to the specified 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.
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.