public static class

JsonMap.Builder

extends Object
java.lang.Object
   ↳ com.urbanairship.json.JsonMap.Builder

Class Overview

Builder class for JsonMap Objects.

Summary

Public Methods
JsonMap build()
Create the JSON map.
JsonMap.Builder put(String key, double value)
Add a key and value to the JSON map.
JsonMap.Builder put(String key, int value)
Add a key and value to the JSON map.
JsonMap.Builder put(String key, long value)
Add a key and value to the JSON map.
JsonMap.Builder put(String key, JsonSerializable value)
Add a key and value to the JSON map.
JsonMap.Builder put(String key, String value)
Add a key and value to the JSON map.
JsonMap.Builder put(String key, char value)
Add a key and value to the JSON map.
JsonMap.Builder put(String key, boolean value)
Add a key and value to the JSON map.
JsonMap.Builder putAll(JsonMap map)
Add a pre-existing JSON map to the JSON map.
JsonMap.Builder putOpt(String key, Object value)
Add a key and value to the JSON map.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public JsonMap build ()

Create the JSON map.

Returns
  • The created JSON map.

public JsonMap.Builder put (String key, double value)

Add a key and value to the JSON map.

Parameters
key The key as a String.
value The value as a double.
Returns
  • The JSON map builder.

public JsonMap.Builder put (String key, int value)

Add a key and value to the JSON map.

Parameters
key The key as a String.
value The value as an int.
Returns
  • The JSON map builder.

public JsonMap.Builder put (String key, long value)

Add a key and value to the JSON map.

Parameters
key The key as a String.
value The value as a long.
Returns
  • The JSON map builder.

public JsonMap.Builder put (String key, JsonSerializable value)

Add a key and value to the JSON map.

Parameters
key The key as a String.
value The value as a JsonSerializable.
Returns
  • The JSON map builder.

public JsonMap.Builder put (String key, String value)

Add a key and value to the JSON map.

Parameters
key The key as a String.
value The value as a String.
Returns
  • The JSON map builder.

public JsonMap.Builder put (String key, char value)

Add a key and value to the JSON map.

Parameters
key The key as a String.
value The value as a char.
Returns
  • The JSON map builder.

public JsonMap.Builder put (String key, boolean value)

Add a key and value to the JSON map.

Parameters
key The key as a String.
value The value as a boolean.
Returns
  • The JSON map builder.

public JsonMap.Builder putAll (JsonMap map)

Add a pre-existing JSON map to the JSON map.

Parameters
map A JsonMap instance.
Returns
  • The JSON map builder.

public JsonMap.Builder putOpt (String key, Object value)

Add a key and value to the JSON map.

Parameters
key The key as a String.
value The value as an Object. If an exception is thrown while attempting to wrap this object as a JsonValue, it will be swallowed and the entry will be dropped from the map.
Returns
  • The JSON map builder.