Class Playlist

  • All Implemented Interfaces:
    android.os.Parcelable, java.io.Serializable

    public class Playlist
    extends MetadataObject
    implements android.os.Parcelable
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Playlist.Fields
      Provides the list of known field names that can appear in the properties Map.
      • Nested classes/interfaces inherited from interface android.os.Parcelable

        android.os.Parcelable.ClassLoaderCreator<T extends java.lang.Object>, android.os.Parcelable.Creator<T extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static android.os.Parcelable.Creator<Playlist> CREATOR
      Creator for de-serializing playlist from the given Parcel.
      static Playlist EMPTY_PLAYLIST
      An empty playlist.
      static int PARCEL_OBJECT_TYPE
      The type of the parcelable object.
      • Fields inherited from interface android.os.Parcelable

        CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
    • Constructor Summary

      Constructors 
      Constructor Description
      Playlist​(java.util.Map<java.lang.String,​java.lang.Object> properties)  
      Playlist​(java.util.Map<java.lang.String,​java.lang.Object> properties, java.util.List<Video> videos)
      Initializes a new Playlist with a predefined metadata properties collection and a predefined List of Video objects.
    • Field Detail

      • EMPTY_PLAYLIST

        public static final Playlist EMPTY_PLAYLIST
        An empty playlist.
      • PARCEL_OBJECT_TYPE

        public static final int PARCEL_OBJECT_TYPE
        The type of the parcelable object.
        See Also:
        Constant Field Values
      • CREATOR

        public static android.os.Parcelable.Creator<Playlist> CREATOR
        Creator for de-serializing playlist from the given Parcel.
    • Constructor Detail

      • Playlist

        public Playlist​(java.util.Map<java.lang.String,​java.lang.Object> properties,
                        java.util.List<Video> videos)
        Initializes a new Playlist with a predefined metadata properties collection and a predefined List of Video objects.
        Parameters:
        properties - the metadata assigned to this instance
        videos - a List of videos to associate with this Playlist
        Throws:
        java.lang.IllegalArgumentException - if either or both arguments are null
    • Method Detail

      • getVideos

        public java.util.List<Video> getVideos()
        Retrieves the ordered List of valid Videos contained in this Playlist. Only videos with Video.Status.OK will be returned.
        Returns:
        ordered List of valid videos
      • getErrorVideos

        public java.util.List<Video> getErrorVideos()
        Retrieves the ordered List of error Videos contained in this Playlist. Only videos with Video.Status.ERROR will be returned.
        Returns:
        ordered List of error Videos
      • getAllVideosAndErrors

        public java.util.List<Video> getAllVideosAndErrors()
        Retrieves the ordered List of all valid Videos and error Videos. All videos with both Video.Status.OK and Video.Status.ERROR will be returned.
        Returns:
        ordered List of valid videos and error Videos.
      • getCount

        public java.lang.Integer getCount()
        Retrieves the number of valid videos in this Playlist.
        Returns:
        the number of valid videos in this playlist
      • describeContents

        public int describeContents()
        Specified by:
        describeContents in interface android.os.Parcelable
      • writeToParcel

        public void writeToParcel​(android.os.Parcel parcel,
                                  int i)
        Specified by:
        writeToParcel in interface android.os.Parcelable