com.brightcove.player.model

## Class Playlist

- java.lang.Object
- - com.brightcove.player.model.MetadataObject
  - - com.brightcove.player.model.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 and 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>, android.os.Parcelable.Creator<T>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and 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 class com.brightcove.player.model.MetadataObject

      `properties, TAG`

    - ### Fields inherited from interface android.os.Parcelable

      `CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE`

  - ### Constructor Summary

    Constructors
    Constructor and 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.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `describeContents()`
    `java.util.List<Video>` | `getAllVideosAndErrors()` Retrieves the ordered List of all valid Videos and error Videos.
    `java.lang.Integer` | `getCount()` Retrieves the number of valid videos in this Playlist.
    `java.util.List<Video>` | `getErrorVideos()` Retrieves the ordered List of error Videos contained in this Playlist.
    `java.util.List<Video>` | `getVideos()` Retrieves the ordered List of valid Videos contained in this Playlist.
    `java.lang.String` | `toString()`
    `void` | `writeToParcel(android.os.Parcel parcel, int i)`

    - ### Methods inherited from class com.brightcove.player.model.MetadataObject

      `getIntegerProperty, getIntegerProperty, getLongProperty, getProperties, getStringProperty, getStringProperty`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### 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)

      See Also:
        `MetadataObject.MetadataObject(java.util.Map)`

    - #### 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

    - #### toString

          @NonNull
          public java.lang.String toString()

      Overrides:
        `toString` in class `MetadataObject`

    - #### 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`