Class FavoriteItem
- java.lang.Object
-
- aero.panasonic.inflight.services.user.favorites.FavoriteItem
-
- All Implemented Interfaces:
java.util.Comparator<FavoriteItem>
public class FavoriteItem extends java.lang.Object implements java.util.Comparator<FavoriteItem>
This class models a media item which can be added to aFavoritesListV1.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFavoriteItem.AvailabilityStatusManages the availability status of the media item for the specific flight
-
Constructor Summary
Constructors Constructor Description FavoriteItem(java.lang.String mediaUri)Creates a media content item in the Favorites List.FavoriteItem(JSONObject json)Constructor which generates an instances of this class from aJSONObject.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intcompare(FavoriteItem lhs, FavoriteItem rhs)booleanequals(java.lang.Object o)FavoriteItem.AvailabilityStatusgetAvailabilityStatus()Returns availability status of the media content.java.lang.StringgetContentType()Returns contentType, such as AOD, VOD, TV or radio, of the media Item.java.lang.StringgetDuration()Returns the length of playing time for the media content.floatgetElapsedTime()Returns the amount of time the media item has playedjava.lang.StringgetGlobalUri()Returns global identifier of the media Item.java.lang.StringgetMediaUri()Returns the media identifier for the media itemsjava.lang.StringgetmMediaUri()Deprecated.UsegetMediaUri()insteadjava.lang.StringgetParentMediaUri()Gets the mParentMediaUri for the child media content URIdoublegetRating()Returns user rating of the media itemjava.lang.StringgetSynopsisUrl()Returns URL for the media item poster.java.lang.StringgetTag()Returns custom tag of the media item.java.lang.StringgetTitle()Returns title of the media itemintgetViewCount()Returns the number of times the media item has played.inthashCode()voidsetContentType(java.lang.String contentType)Sets contentType, such as AOD, VOD, TV or radio, of the media itemvoidsetElapsedTime(long mElapsedTime)Sets the amount of time the media item has played.voidsetGlobalUri(java.lang.String globalUri)Sets the global media identifier for the media itemsvoidsetMediaUri(java.lang.String mMediaUri)Sets the media identifier for the media itemsvoidsetParentMediaUri(java.lang.String mParentMediaUri)Sets the value for the parent identifier in a bundle.voidsetRating(int mRating)Sets the rating of the media content item.voidsetSynopsisUrl(java.lang.String synopsisUrl)Sets the URL for the media item synopsis.voidsetTag(java.lang.String tag)Sets the custom tagvoidsetTitle(java.lang.String subTitle)Sets the title of the media itemJSONObjecttoJson()Exports the favorites item to aJSONObject, which can be used to transfer the Favorites List to the seatback monitor.java.lang.StringtoString()
-
-
-
Constructor Detail
-
FavoriteItem
public FavoriteItem(java.lang.String mediaUri)
Creates a media content item in the Favorites List. The call uses a media URI.- Parameters:
mediaUri-
-
FavoriteItem
public FavoriteItem(JSONObject json)
Constructor which generates an instances of this class from aJSONObject.- Parameters:
json-
-
-
Method Detail
-
toJson
public JSONObject toJson()
Exports the favorites item to aJSONObject, which can be used to transfer the Favorites List to the seatback monitor.- Returns:
- json string
-
compare
public int compare(FavoriteItem lhs, FavoriteItem rhs)
- Specified by:
comparein interfacejava.util.Comparator<FavoriteItem>
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equalsin interfacejava.util.Comparator<FavoriteItem>- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setRating
public void setRating(int mRating)
Sets the rating of the media content item. The rating is assigned by the passenger. This allows the app developer to log the items by rating. The rating is a float from 1 to 5- Parameters:
mRating- int the mRating to set
-
getDuration
public java.lang.String getDuration()
Returns the length of playing time for the media content. The duration is in seconds.- Returns:
-
setElapsedTime
public void setElapsedTime(long mElapsedTime)
Sets the amount of time the media item has played. The elapsed time is in seconds.- Parameters:
mElapsedTime- long the mElapsedTime to set
-
getParentMediaUri
public java.lang.String getParentMediaUri()
Gets the mParentMediaUri for the child media content URI- Returns:
- java.lang.String
-
setParentMediaUri
public void setParentMediaUri(java.lang.String mParentMediaUri)
Sets the value for the parent identifier in a bundle.- Parameters:
mParentMediaUri- java.lang.String the mParentMediaUri to set
-
getElapsedTime
public float getElapsedTime()
Returns the amount of time the media item has played- Returns:
-
getRating
public double getRating()
Returns user rating of the media item- Returns:
-
getViewCount
public int getViewCount()
Returns the number of times the media item has played.- Returns:
-
getGlobalUri
public java.lang.String getGlobalUri()
Returns global identifier of the media Item.- Returns:
- String
-
getmMediaUri
public java.lang.String getmMediaUri()
Deprecated.UsegetMediaUri()insteadReturns the media identifier for the media items- Returns:
- java.lang.String
-
getMediaUri
public java.lang.String getMediaUri()
Returns the media identifier for the media items- Returns:
- java.lang.String
-
setMediaUri
public void setMediaUri(java.lang.String mMediaUri)
Sets the media identifier for the media items- Parameters:
mMediaUri- java.lang.String the mMediaUri to set
-
setGlobalUri
public void setGlobalUri(java.lang.String globalUri)
Sets the global media identifier for the media items- Parameters:
globalUri-
-
getContentType
public java.lang.String getContentType()
Returns contentType, such as AOD, VOD, TV or radio, of the media Item.- Returns:
- String
-
setContentType
public void setContentType(java.lang.String contentType)
Sets contentType, such as AOD, VOD, TV or radio, of the media item- Parameters:
contentType-
-
getTitle
public java.lang.String getTitle()
Returns title of the media item- Returns:
-
setTitle
public void setTitle(java.lang.String subTitle)
Sets the title of the media item- Parameters:
subTitle-
-
getSynopsisUrl
public java.lang.String getSynopsisUrl()
Returns URL for the media item poster.- Returns:
-
setSynopsisUrl
public void setSynopsisUrl(java.lang.String synopsisUrl)
Sets the URL for the media item synopsis.- Parameters:
synopsisUrl-
-
getTag
public java.lang.String getTag()
Returns custom tag of the media item.- Returns:
-
setTag
public void setTag(java.lang.String tag)
Sets the custom tag- Parameters:
tag- java.lang.String the mTag to set
-
getAvailabilityStatus
public FavoriteItem.AvailabilityStatus getAvailabilityStatus()
Returns availability status of the media content. For example, the media could be available in first class, but not in other classes.- Returns:
- AvailabilityStatus The status is either valid or invalid.
-
-