public class BranchLinkData
extends org.json.JSONObject
The BranchLinkData object is based on JSONObject and expands the class to enable
collections of tags.
Tags are returned from the server, and form the data dictionary that each deep link shared via the Branch platform contains.
| Constructor and Description |
|---|
BranchLinkData()
BranchLinkData constructor requires no parameters, and is identical to that of its superclass
JSONObject. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Compares a BranchLinkData object by instance ("is the object the exact same one in memory") and by
associated attributes ("is this object identically configured?")
|
int |
hashCode()
Calculates the hash for this object as currently configured and returns the resultant
int. |
void |
putAlias(java.lang.String alias)
Adds an alias to the link.
|
void |
putChannel(java.lang.String channel)
[Optional] The channel in which the link will be shared.
|
void |
putDuration(int duration)
[Optional] You can set the duration manually.
|
void |
putFeature(java.lang.String feature)
[Optional] The feature in which the link will be used.
|
void |
putParams(java.lang.String params)
Any other params to be added; you can define your own.
|
void |
putStage(java.lang.String stage)
A string value that represents the stage of the user in the app.
|
void |
putTags(java.util.Collection<java.lang.String> tags)
Use this method to add tags to the data dictionary that will go along with the deep link that
is being created.
|
void |
putType(int type)
Adds a type to the link.
|
accumulate, get, getBoolean, getDouble, getInt, getJSONArray, getJSONObject, getLong, getString, has, isNull, keys, length, names, numberToString, opt, optBoolean, optBoolean, optDouble, optDouble, optInt, optInt, optJSONArray, optJSONObject, optLong, optLong, optString, optString, put, put, put, put, put, putOpt, quote, remove, toJSONArray, toString, toString, wrappublic BranchLinkData()
JSONObject.public void putTags(java.util.Collection<java.lang.String> tags)
throws org.json.JSONException
tags - A Collection of String objects, each element of which contains a tag and value to be added
to the data dictionary of a link.
If it is not, a JSONException will be thrown.org.json.JSONExceptionpublic void putAlias(java.lang.String alias)
throws org.json.JSONException
alias - A String value containing the desired alias name to add.org.json.JSONException - The parameter value must be in valid JSON format, or a JSONException
will be thrown.public void putType(int type)
throws org.json.JSONException
type - An Integer value of the type specified. Valid values are:
org.json.JSONException - The parameter value must be in valid JSON format, or a JSONException
will be thrown.public void putDuration(int duration)
throws org.json.JSONException
duration - An Integer value in seconds.
org.json.JSONException - The parameter value must be in valid JSON format, or a JSONException
will be thrown.public void putChannel(java.lang.String channel)
throws org.json.JSONException
channel - A String value containing the channel which the link belongs to.
(max 128 characters)org.json.JSONException - The parameter value must be in valid JSON format, or a JSONException
will be thrown.public void putFeature(java.lang.String feature)
throws org.json.JSONException
feature - A String specifying the feature. (max 128 characters)org.json.JSONException - The parameter value must be in valid JSON format, or a JSONException
will be thrown.public void putStage(java.lang.String stage)
throws org.json.JSONException
stage - A String value specifying the stage.org.json.JSONException - The parameter value must be in valid JSON format, or a JSONException
will be thrown.public void putParams(java.lang.String params)
throws org.json.JSONException
params - A String containing other params in JSON format.org.json.JSONException - The parameter value must be in valid JSON format, or a JSONException
will be thrown.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - A BranchLinkData object to be compared to the one that this method belongs to.public int hashCode()
Calculates the hash for this object as currently configured and returns the resultant int.
The hash value is a combination of the hashCode of:
Changing any of these attributes will change the hashCode, making comparison straightforward.
hashCode in class java.lang.Object