Class 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 a FavoritesListV1.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  FavoriteItem.AvailabilityStatus
      Manages 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 a JSONObject.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      int compare​(FavoriteItem lhs, FavoriteItem rhs)  
      boolean equals​(java.lang.Object o)  
      FavoriteItem.AvailabilityStatus getAvailabilityStatus()
      Returns availability status of the media content.
      java.lang.String getContentType()
      Returns contentType, such as AOD, VOD, TV or radio, of the media Item.
      java.lang.String getDuration()
      Returns the length of playing time for the media content.
      float getElapsedTime()
      Returns the amount of time the media item has played
      java.lang.String getGlobalUri()
      Returns global identifier of the media Item.
      java.lang.String getMediaUri()
      Returns the media identifier for the media items
      java.lang.String getmMediaUri()
      Deprecated.
      Use getMediaUri() instead
      java.lang.String getParentMediaUri()
      Gets the mParentMediaUri for the child media content URI
      double getRating()
      Returns user rating of the media item
      java.lang.String getSynopsisUrl()
      Returns URL for the media item poster.
      java.lang.String getTag()
      Returns custom tag of the media item.
      java.lang.String getTitle()
      Returns title of the media item
      int getViewCount()
      Returns the number of times the media item has played.
      int hashCode()  
      void setContentType​(java.lang.String contentType)
      Sets contentType, such as AOD, VOD, TV or radio, of the media item
      void setElapsedTime​(long mElapsedTime)
      Sets the amount of time the media item has played.
      void setGlobalUri​(java.lang.String globalUri)
      Sets the global media identifier for the media items
      void setMediaUri​(java.lang.String mMediaUri)
      Sets the media identifier for the media items
      void setParentMediaUri​(java.lang.String mParentMediaUri)
      Sets the value for the parent identifier in a bundle.
      void setRating​(int mRating)
      Sets the rating of the media content item.
      void setSynopsisUrl​(java.lang.String synopsisUrl)
      Sets the URL for the media item synopsis.
      void setTag​(java.lang.String tag)
      Sets the custom tag
      void setTitle​(java.lang.String subTitle)
      Sets the title of the media item
      JSONObject toJson()
      Exports the favorites item to a JSONObject, which can be used to transfer the Favorites List to the seatback monitor.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • 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 a JSONObject.
        Parameters:
        json -
    • Method Detail

      • toJson

        public JSONObject toJson()
        Exports the favorites item to a JSONObject, which can be used to transfer the Favorites List to the seatback monitor.
        Returns:
        json string
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Comparator<FavoriteItem>
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.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.
        Use getMediaUri() instead
        Returns 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.