public class

ActionValue

extends Object
implements Parcelable JsonSerializable
java.lang.Object
   ↳ com.urbanairship.actions.ActionValue

Class Overview

An ActionValue is a representation of any value that can be described using JSON. It can contain one of the following: a JsonMap, a JsonList, a Number, a Boolean, String, or it can contain null.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<ActionValue> CREATOR ActionValue parcel creator.
Public Constructors
ActionValue(JsonValue jsonValue)
Creates an ActionValue from a JsonValue.
ActionValue()
Creates an empty ActionValue.
Public Methods
int describeContents()
boolean equals(Object object)
boolean getBoolean(boolean defaultValue)
Gets the contained values as a boolean.
double getDouble(double defaultValue)
Gets the contained values as an double.
int getInt(int defaultValue)
Gets the contained values as an int.
JsonList getList()
Gets the contained values as a JsonList.
long getLong(long defaultValue)
Gets the contained values as an long.
JsonMap getMap()
Gets the contained values as a JsonMap.
String getString(String defaultValue)
Gets the contained values as a String.
String getString()
Gets the contained value as a String.
int hashCode()
boolean isNull()
If the contained value is null.
JsonValue toJsonValue()
Returns the objects represented as a JsonValue.
String toString()
Returns the ActionValue as a JSON encoded String.
static ActionValue wrap(int value)
Wraps an int as an ActionValue.
static ActionValue wrap(Object object)
Wraps a JsonValue compatible object as an ActionValue.
static ActionValue wrap(boolean value)
Wraps a boolean as an ActionValue.
static ActionValue wrap(String value)
Wraps a String as an ActionValue.
static ActionValue wrap(char value)
Wraps a char as an ActionValue.
static ActionValue wrap(JsonSerializable value)
Wraps a JsonSerializable object as an ActionValue.
static ActionValue wrap(long value)
Wraps a long as an ActionValue.
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable
From interface com.urbanairship.json.JsonSerializable

Fields

public static final Creator<ActionValue> CREATOR

ActionValue parcel creator.

Public Constructors

public ActionValue (JsonValue jsonValue)

Creates an ActionValue from a JsonValue.

Parameters
jsonValue A jsonValue.

public ActionValue ()

Creates an empty ActionValue.

Public Methods

public int describeContents ()

public boolean equals (Object object)

public boolean getBoolean (boolean defaultValue)

Gets the contained values as a boolean.

Parameters
defaultValue The default value if the contained value is not a boolean.
Returns
  • The value as a boolean, or the defaultValue if the value is not a boolean.

public double getDouble (double defaultValue)

Gets the contained values as an double.

Parameters
defaultValue The default value if the contained value is not a number.
Returns
  • The value as a double, or the defaultValue if the value is not a number.

public int getInt (int defaultValue)

Gets the contained values as an int.

Parameters
defaultValue The default value if the contained value is not a number.
Returns
  • The value as an int, or the defaultValue if the value is not a number.

public JsonList getList ()

Gets the contained values as a JsonList.

Returns
  • The value as a JsonList, or null if the value is not a JsonList.

public long getLong (long defaultValue)

Gets the contained values as an long.

Parameters
defaultValue The default value if the contained value is not a number.
Returns
  • The value as a long, or the defaultValue if the value is not a number.

public JsonMap getMap ()

Gets the contained values as a JsonMap.

Returns
  • The value as a JsonMap, or null if the value is not a JsonMap.

public String getString (String defaultValue)

Gets the contained values as a String.

Parameters
defaultValue The default value if the contained value is not a String.
Returns
  • The value as a String, or the defaultValue if the value is not a String.

public String getString ()

Gets the contained value as a String.

Returns
  • The value as a String, or null if the value is not a String.

public int hashCode ()

public boolean isNull ()

If the contained value is null.

Returns
  • true if the contained value is null, otherwise false.

public JsonValue toJsonValue ()

Returns the objects represented as a JsonValue.

Returns
  • The object as a JsonValue.

public String toString ()

Returns the ActionValue as a JSON encoded String.

Returns
  • The value as a JSON encoded String.

public static ActionValue wrap (int value)

Wraps an int as an ActionValue.

Parameters
value The action's value as an int.
Returns
  • The ActionValue object.

public static ActionValue wrap (Object object)

Wraps a JsonValue compatible object as an ActionValue.

Parameters
object The action's value.
Returns
  • The ActionValue object.
Throws
ActionValueException If the object is unable to be wrapped into an action value.

public static ActionValue wrap (boolean value)

Wraps a boolean as an ActionValue.

Parameters
value The action's value as a boolean.
Returns
  • The ActionValue object.

public static ActionValue wrap (String value)

Wraps a String as an ActionValue.

Parameters
value The action's value as a string.
Returns
  • The ActionValue object.

public static ActionValue wrap (char value)

Wraps a char as an ActionValue.

Parameters
value The action's value as a char.
Returns
  • The ActionValue object.

public static ActionValue wrap (JsonSerializable value)

Wraps a JsonSerializable object as an ActionValue.

Parameters
value The action's value as a JsonSerializable object.
Returns
  • The ActionValue object.

public static ActionValue wrap (long value)

Wraps a long as an ActionValue.

Parameters
value The action's value as a long.
Returns
  • The ActionValue object.

public void writeToParcel (Parcel dest, int flags)