Package com.battlelancer.seriesguide.api
Class Action
- java.lang.Object
-
- com.battlelancer.seriesguide.api.Action
-
public class Action extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAction.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ActionfromBundle(Bundle bundle)static ActionfromJson(JSONObject jsonObject)Deserializes aJSONObjectinto anActionobject.intgetEntityIdentifier()Returns an identifier unique within the entity type.StringgetTitle()Returns the user-visible title for this action.IntentgetViewIntent()Returns the activityIntentthat will be started when the user clicks on the button for this action.BundletoBundle()JSONObjecttoJson()Serializes thisActionobject to aJSONObjectrepresentation.
-
-
-
Method Detail
-
getTitle
public String getTitle()
Returns the user-visible title for this action.
-
getViewIntent
public Intent getViewIntent()
Returns the activityIntentthat will be started when the user clicks on the button for this action.
-
getEntityIdentifier
public int getEntityIdentifier()
Returns an identifier unique within the entity type. E.g. for episodes the TVDb id. Extensions may use it to determine if there was an action already built for this entity and consequently just re-send it.SeriesGuide will use the identifier to match a published action to its request, e.g. which episode the action belongs to.
-
toBundle
public Bundle toBundle()
-
toJson
public JSONObject toJson() throws JSONException
Serializes thisActionobject to aJSONObjectrepresentation.- Throws:
JSONException
-
fromJson
public static Action fromJson(JSONObject jsonObject) throws JSONException
Deserializes aJSONObjectinto anActionobject.- Throws:
JSONException
-
-