Share via


JSONObject.Put Method

Definition

Overloads

Put(String, Int64)

Maps name to value, clobbering any existing name/value mapping with the same name.

Put(String, Int32)

Maps name to value, clobbering any existing name/value mapping with the same name.

Put(String, Object)

Maps name to value, clobbering any existing name/value mapping with the same name.

Put(String, Boolean)

Maps name to value, clobbering any existing name/value mapping with the same name.

Put(String, Double)

Maps name to value, clobbering any existing name/value mapping with the same name.

Put(String, Int64)

Maps name to value, clobbering any existing name/value mapping with the same name.

[Android.Runtime.Register("put", "(Ljava/lang/String;J)Lorg/json/JSONObject;", "GetPut_Ljava_lang_String_JHandler")]
public virtual Org.Json.JSONObject Put (string name, long value);
[<Android.Runtime.Register("put", "(Ljava/lang/String;J)Lorg/json/JSONObject;", "GetPut_Ljava_lang_String_JHandler")>]
abstract member Put : string * int64 -> Org.Json.JSONObject
override this.Put : string * int64 -> Org.Json.JSONObject

Parameters

name
String
value
Int64

a finite value. May not be Double#isNaN() NaNs or Double#isInfinite() infinities.

Returns

this object.

Attributes

Exceptions

Remarks

Maps name to value, clobbering any existing name/value mapping with the same name.

Java documentation for org.json.JSONObject.put(java.lang.String, long).

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

Put(String, Int32)

Maps name to value, clobbering any existing name/value mapping with the same name.

[Android.Runtime.Register("put", "(Ljava/lang/String;I)Lorg/json/JSONObject;", "GetPut_Ljava_lang_String_IHandler")]
public virtual Org.Json.JSONObject Put (string name, int value);
[<Android.Runtime.Register("put", "(Ljava/lang/String;I)Lorg/json/JSONObject;", "GetPut_Ljava_lang_String_IHandler")>]
abstract member Put : string * int -> Org.Json.JSONObject
override this.Put : string * int -> Org.Json.JSONObject

Parameters

name
String
value
Int32

a finite value. May not be Double#isNaN() NaNs or Double#isInfinite() infinities.

Returns

this object.

Attributes

Exceptions

Remarks

Maps name to value, clobbering any existing name/value mapping with the same name.

Java documentation for org.json.JSONObject.put(java.lang.String, int).

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

Put(String, Object)

Maps name to value, clobbering any existing name/value mapping with the same name.

[Android.Runtime.Register("put", "(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;", "GetPut_Ljava_lang_String_Ljava_lang_Object_Handler")]
public virtual Org.Json.JSONObject Put (string name, Java.Lang.Object? value);
[<Android.Runtime.Register("put", "(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;", "GetPut_Ljava_lang_String_Ljava_lang_Object_Handler")>]
abstract member Put : string * Java.Lang.Object -> Org.Json.JSONObject
override this.Put : string * Java.Lang.Object -> Org.Json.JSONObject

Parameters

name
String
value
Object

a JSONObject, JSONArray, String, Boolean, Integer, Long, Double, #NULL, or null. May not be Double#isNaN() NaNs or Double#isInfinite() infinities.

Returns

this object.

Attributes

Exceptions

Remarks

Maps name to value, clobbering any existing name/value mapping with the same name. If the value is null, any existing mapping for name is removed.

Java documentation for org.json.JSONObject.put(java.lang.String, 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

Put(String, Boolean)

Maps name to value, clobbering any existing name/value mapping with the same name.

[Android.Runtime.Register("put", "(Ljava/lang/String;Z)Lorg/json/JSONObject;", "GetPut_Ljava_lang_String_ZHandler")]
public virtual Org.Json.JSONObject Put (string name, bool value);
[<Android.Runtime.Register("put", "(Ljava/lang/String;Z)Lorg/json/JSONObject;", "GetPut_Ljava_lang_String_ZHandler")>]
abstract member Put : string * bool -> Org.Json.JSONObject
override this.Put : string * bool -> Org.Json.JSONObject

Parameters

name
String
value
Boolean

a finite value. May not be Double#isNaN() NaNs or Double#isInfinite() infinities.

Returns

this object.

Attributes

Exceptions

Remarks

Maps name to value, clobbering any existing name/value mapping with the same name.

Java documentation for org.json.JSONObject.put(java.lang.String, boolean).

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

Put(String, Double)

Maps name to value, clobbering any existing name/value mapping with the same name.

[Android.Runtime.Register("put", "(Ljava/lang/String;D)Lorg/json/JSONObject;", "GetPut_Ljava_lang_String_DHandler")]
public virtual Org.Json.JSONObject Put (string name, double value);
[<Android.Runtime.Register("put", "(Ljava/lang/String;D)Lorg/json/JSONObject;", "GetPut_Ljava_lang_String_DHandler")>]
abstract member Put : string * double -> Org.Json.JSONObject
override this.Put : string * double -> Org.Json.JSONObject

Parameters

name
String
value
Double

a finite value. May not be Double#isNaN() NaNs or Double#isInfinite() infinities.

Returns

this object.

Attributes

Exceptions

Remarks

Maps name to value, clobbering any existing name/value mapping with the same name.

Java documentation for org.json.JSONObject.put(java.lang.String, double).

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