public class

PlacementContext

extends JSONObject
implements Parcelable
java.lang.Object
   ↳ org.json.JSONObject
     ↳ com.usebutton.sdk.PlacementContext

Class Overview

Convenience class on top of JSONObject. Mutable key-value pairs with promotion relevant information.

Summary

Nested Classes
class PlacementContext.Location  
Constants
String END_LOCATION
String KEY_DISPLAY_NAME
String KEY_LATITUDE
String KEY_LONGITUDE
String START_LOCATION
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static Creator<PlacementContext> CREATOR
[Expand]
Inherited Fields
From class org.json.JSONObject
Public Constructors
PlacementContext(Map<StringString> map)
PlacementContext()
PlacementContext(Parcel source)
Public Methods
int describeContents()
static PlacementContext forEndLocation(String locationName, Location location)
static PlacementContext forEndLocation(String locationName, double latitude, double longitude)
static PlacementContext fromMap(Map<StringString> map)
LatLngPair getEndLocation()
String getEndName()
LatLngPair getStartLocation()
String getStartName()
PlacementContext withEndLocation(LatLngPair coordinate)
PlacementContext withEndLocation(String locationName, LatLngPair coordinate)
PlacementContext withStartLocation(String locationName, LatLngPair coordinate)
PlacementContext withStartLocation(String locationName, double latitude, double longitude)
PlacementContext withStartLocation(LatLngPair coordinate)
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class org.json.JSONObject
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final String END_LOCATION

Constant Value: "end_location"

public static final String KEY_DISPLAY_NAME

Constant Value: "display_name"

public static final String KEY_LATITUDE

Constant Value: "latitude"

public static final String KEY_LONGITUDE

Constant Value: "longitude"

public static final String START_LOCATION

Constant Value: "start_location"

Fields

public static Creator<PlacementContext> CREATOR

Public Constructors

public PlacementContext (Map<StringString> map)

public PlacementContext ()

public PlacementContext (Parcel source)

Throws
JSONException

Public Methods

public int describeContents ()

public static PlacementContext forEndLocation (String locationName, Location location)

public static PlacementContext forEndLocation (String locationName, double latitude, double longitude)

public static PlacementContext fromMap (Map<StringString> map)

public LatLngPair getEndLocation ()

Returns
  • coordinate pair under end_location if set or null

public String getEndName ()

public LatLngPair getStartLocation ()

Returns
  • coordinate pair under start_location if set or null

public String getStartName ()

public PlacementContext withEndLocation (LatLngPair coordinate)

public PlacementContext withEndLocation (String locationName, LatLngPair coordinate)

public PlacementContext withStartLocation (String locationName, LatLngPair coordinate)

public PlacementContext withStartLocation (String locationName, double latitude, double longitude)

public PlacementContext withStartLocation (LatLngPair coordinate)

public void writeToParcel (Parcel dest, int flags)