Class Playlist
- java.lang.Object
-
- aero.panasonic.inflight.services.user.v2.playlist.Playlist
-
public class Playlist extends java.lang.ObjectPackage - The Playlist, a component of the User module, allows passengers to create a list of media content, such as movies, music or audiobooks, on their personal electronic devices (PED).
The same Playlist can be used over multiple flights, if synchronized, and passengers can add and remove media content at any time.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(PlaylistItem playlistItem)Adds a single item to the end of the media queue.booleanadd(PlaylistItem playlistItem, int position)Adds a single item to the specific position in the FavouriteList.intadd(java.util.List<PlaylistItem> playlistItems)Adds all new media items to the end of the media queue, then returns the number of items on the List.intadd(java.util.List<PlaylistItem> playlistItems, int position)Inserts the provided media items into the FavouriteList at the specified position.voidclear()Clears all media content from the Playlist.java.util.List<PlaylistItem>getItems()Gets a list of all media content, such as movies, music and audio books, in the Playlist.java.util.List<PlaylistItem>getItemsByContentType(java.lang.String contentType)Returns a list of media items byContentType.java.lang.StringgetPlaylistName()Returns the name of the playlistbooleanremove(PlaylistItem playlistItem)Removes a media content from the Playlist.booleanremove(java.lang.String playlistItemId)Removes the specified media content from the Playlist.intremove(java.util.List<java.lang.String> playlistItemIds)java.lang.StringtoString()For internal use
-
-
-
Method Detail
-
getPlaylistName
public java.lang.String getPlaylistName()
Returns the name of the playlist- Returns:
- Name of the playlist
-
add
public int add(java.util.List<PlaylistItem> playlistItems) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
Adds all new media items to the end of the media queue, then returns the number of items on the List.- Parameters:
playlistItems- A list of items to be added to the Playlist- Returns:
- The number of items added
- Throws:
java.lang.NullPointerExceptionjava.lang.IllegalArgumentException
-
add
public int add(java.util.List<PlaylistItem> playlistItems, int position) throws java.lang.IndexOutOfBoundsException, java.lang.NullPointerException, java.lang.IllegalArgumentException
Inserts the provided media items into the FavouriteList at the specified position. and returns the number of items added.If the provided
positionis invalid (less than 0 or greater than the current size of the FavouriteList), this method throwsIndexOutOfBoundsExceptionand no items are added.- Parameters:
playlistItems- A list of items to be inserted into the Playlistposition- The index at which the items should be inserted- Returns:
- The number of items added
- Throws:
java.lang.IndexOutOfBoundsExceptionjava.lang.NullPointerExceptionjava.lang.IllegalArgumentException
-
add
public boolean add(PlaylistItem playlistItem) throws java.lang.NullPointerException
Adds a single item to the end of the media queue. This call verifies the media content is not currently in the Playlist. The list cannot contain identical media content.- Parameters:
playlistItem- to be added- Returns:
- True, if added.
- Throws:
java.lang.NullPointerException- False, if the content is identical to content currently in the Playlist.
-
add
public boolean add(PlaylistItem playlistItem, int position) throws java.lang.IndexOutOfBoundsException, java.lang.NullPointerException
Adds a single item to the specific position in the FavouriteList. This call verifies the media content is not currently in the Playlist. The list cannot contain identical media content.- Parameters:
playlistItem- to be addedposition- The index at which the items should be inserted- Returns:
- True, if added.
- Throws:
java.lang.IndexOutOfBoundsExceptionjava.lang.NullPointerException
-
remove
public boolean remove(PlaylistItem playlistItem)
Removes a media content from the Playlist.- Parameters:
playlistItem- The Playlist item removed. It's removed as an object/- Returns:
- True, if collection was modified
False, if not modified.
-
remove
public boolean remove(java.lang.String playlistItemId)
Removes the specified media content from the Playlist.- Parameters:
playlistItemId- The @Playlist. content to be removed- Returns:
- True, if collection was modified
False, if not modified.
-
remove
public int remove(java.util.List<java.lang.String> playlistItemIds)
-
clear
public void clear()
Clears all media content from the Playlist.
-
getItems
public java.util.List<PlaylistItem> getItems()
Gets a list of all media content, such as movies, music and audio books, in the Playlist.- Returns:
-
getItemsByContentType
public java.util.List<PlaylistItem> getItemsByContentType(java.lang.String contentType)
Returns a list of media items byContentType.
If there are no matching items, it return an empty list.- Parameters:
contentType- The media content typeContentType- Returns:
- List of
PlaylistItem
-
toString
public java.lang.String toString()
For internal use- Overrides:
toStringin classjava.lang.Object
-
-