com.brightcove.proserve.mediaapi.wrapper.apiobjects
Class Playlist

java.lang.Object
  extended by com.brightcove.proserve.mediaapi.wrapper.apiobjects.Playlist

public class Playlist
extends java.lang.Object

Represents a Playlist object to/from the Media API.

From the Brightcove documentation on 2009/08/18 (http://support.brightcove.com/en/docs/media-api-objects-reference#Playlist):
The Playlist object is a collection of Videos. A Playlist has the following properties::

property name type read only? description
id long yes A number that uniquely identifies this Playlist. This id is automatically assigned when the Playlist is created.
referenceId String no A user-specified id, limited to 150 characters, that uniquely identifies this Playlist. Note that the find_playlists_by_reference_ids method cannot handle referenceIds that contain commas, so you may want to avoid using commas in referenceId values.
accountId long yes A number that uniquely identifies the account to which this Playlist belongs, assigned by Brightcove.
name String no The title of this Playlist, limited to 50 characters. The name is a required property when you create a playlist.
shortDescription String no A short description describing this Playlist, limited to 250 characters.
videoIds List no A list of the ids of the Videos that are encapsulated in this Playlist.
videos List no A list of the Video objects that are encapsulated in this Playlist.
playlistType Enum no Options are OLDEST_TO_NEWEST, NEWEST_TO_OLDEST, ALPHABETICAL, PLAYSTOTAL, and PLAYS_TRAILING_WEEK (each of which is a smart playlist, ordered as indicated) or EXPLICIT (a manual playlist). The playlistType is a required property when you create a playlist.
filterTags List no A list of the tags that define this smart playlist. For example:

"filterTags":["Sitka","ticks"]
thumbnailURL String yes The URL of the thumbnail associated with this Playlist.

Author:
Sander Gates

Constructor Summary
Playlist()
          Default Constructor.
Playlist(JSONObject jsonObj)
          Constructor using JSON object.
Playlist(java.lang.String json)
          Constructor using JSON string.
 
Method Summary
 java.lang.Long getAccountId()
          Gets the account id for this Playlist.
 java.util.List<java.lang.String> getFilterTags()
          Gets the filter tags for this Playlist.
 java.lang.Long getId()
          Gets the id for this Playlist.
 java.lang.String getName()
          Gets the name (title) for this Playlist.
 PlaylistTypeEnum getPlaylistType()
          Gets the type for this Playlist.
 java.lang.String getReferenceId()
          Gets the reference id for this Playlist.
 java.lang.String getShortDescription()
          Gets the short description for this Playlist.
 java.lang.String getThumbnailUrl()
          Gets the thumbnail URL for this Playlist.
 java.util.List<java.lang.Long> getVideoIds()
          Gets the Video Ids for this Playlist.
 java.util.List<Video> getVideos()
          Gets the Videos for this Playlist.
 void initAll()
          Fully initializes the playlist object by setting all fields to null
 void setAccountId(java.lang.Long accountId)
          Sets the account id for this Playlist.
 void setFilterTags(java.util.List<java.lang.String> filterTags)
          Sets the filter tags for this Playlist.
 void setId(java.lang.Long id)
          Sets the id for this Playlist.
 void setName(java.lang.String name)
          Sets the name (title) for this Playlist.
 void setPlaylistType(PlaylistTypeEnum playlistType)
          Sets the type for this Playlist.
 void setReferenceId(java.lang.String referenceId)
          Sets the reference id for this Playlist.
 void setShortDescription(java.lang.String shortDescription)
          Sets the short description for this Playlist.
 void setThumbnailUrl(java.lang.String thumbnailUrl)
          Sets the thumbnail URL for this Playlist.
 void setVideoIds(java.util.List<java.lang.Long> videoIds)
          Sets the Video Ids for this Playlist.
 void setVideos(java.util.List<Video> videos)
          Sets the Videos for this Playlist.
 JSONObject toJson()
          Converts the video into a JSON object suitable for use with the Media API
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Playlist

public Playlist()

Default Constructor.

All fields set to null to start - required fields must be set before calling Write Media API.


Playlist

public Playlist(java.lang.String json)
         throws JSONException

Constructor using JSON string.

Given a JSON string from the Media API, attempts to construct a new Playlist object and fill out all of the fields defined. All other fields will be null.

Throws:
JSONException

Playlist

public Playlist(JSONObject jsonObj)
         throws JSONException

Constructor using JSON object.

Given a JSON object from the Media API, attempts to construct a new Playlist object and fill out all of the fields defined. All other fields will be null.

Throws:
JSONException
Method Detail

initAll

public void initAll()

Fully initializes the playlist object by setting all fields to null


getId

public java.lang.Long getId()

Gets the id for this Playlist.

A number that uniquely identifies this Playlist. This id is automatically assigned when the Playlist is created.

Returns:
The id for this Playlist

getReferenceId

public java.lang.String getReferenceId()

Gets the reference id for this Playlist.

A user-specified id, limited to 150 characters, that uniquely identifies this Playlist. Note that the find_playlists_by_reference_ids method cannot handle referenceIds that contain commas, so you may want to avoid using commas in referenceId values.

Returns:
Reference id for this Playlist

getAccountId

public java.lang.Long getAccountId()

Gets the account id for this Playlist.

A number that uniquely identifies the account to which this Playlist belongs, assigned by Brightcove.

Returns:
Account id for this Playlist

getName

public java.lang.String getName()

Gets the name (title) for this Playlist.

The title of this Playlist, limited to 50 characters. The name is a required property when you create a playlist.

Returns:
Name of the Playlist

getShortDescription

public java.lang.String getShortDescription()

Gets the short description for this Playlist.

A short description describing this Playlist, limited to 250 characters.

Returns:
Short description for this Playlist

getVideoIds

public java.util.List<java.lang.Long> getVideoIds()

Gets the Video Ids for this Playlist.

A list of the ids of the Videos that are encapsulated in this Playlist.

Returns:
Video Ids for this Playlist

getVideos

public java.util.List<Video> getVideos()

Gets the Videos for this Playlist.

A list of the Video objects that are encapsulated in this Playlist.

Returns:
Videos for this Playlist

getPlaylistType

public PlaylistTypeEnum getPlaylistType()

Gets the type for this Playlist.

Options are OLDEST_TO_NEWEST, NEWEST_TO_OLDEST, ALPHABETICAL, PLAYSTOTAL, and PLAYS_TRAILING_WEEK (each of which is a smart playlist, ordered as indicated) or EXPLICIT (a manual playlist). The playlistType is a required property when you create a playlist.

Returns:
Type for this Playlist

getFilterTags

public java.util.List<java.lang.String> getFilterTags()

Gets the filter tags for this Playlist.

A list of the tags that define this smart playlist. For example:

"filterTags":["Sitka","ticks"]

Returns:
Filter tags for this Playlist

getThumbnailUrl

public java.lang.String getThumbnailUrl()

Gets the thumbnail URL for this Playlist.

The URL of the thumbnail associated with this Playlist.

Returns:
Thumbnail URL for this Playlist

setId

public void setId(java.lang.Long id)

Sets the id for this Playlist.

A number that uniquely identifies this Playlist. This id is automatically assigned when the Playlist is created.

Parameters:
id - The id for this Playlist

setReferenceId

public void setReferenceId(java.lang.String referenceId)

Sets the reference id for this Playlist.

A user-specified id, limited to 150 characters, that uniquely identifies this Playlist. Note that the find_playlists_by_reference_ids method cannot handle referenceIds that contain commas, so you may want to avoid using commas in referenceId values.

Parameters:
referenceId - Reference id for this Playlist

setAccountId

public void setAccountId(java.lang.Long accountId)

Sets the account id for this Playlist.

A number that uniquely identifies the account to which this Playlist belongs, assigned by Brightcove.

Parameters:
accountId - Account id for this Playlist

setName

public void setName(java.lang.String name)

Sets the name (title) for this Playlist.

The title of this Playlist, limited to 50 characters. The name is a required property when you create a playlist.

Parameters:
name - Name of the Playlist

setShortDescription

public void setShortDescription(java.lang.String shortDescription)

Sets the short description for this Playlist.

A short description describing this Playlist, limited to 250 characters.

Parameters:
shortDescription - Short description for this Playlist

setVideoIds

public void setVideoIds(java.util.List<java.lang.Long> videoIds)

Sets the Video Ids for this Playlist.

A list of the ids of the Videos that are encapsulated in this Playlist.

Parameters:
videoIds - Video Ids for this Playlist

setVideos

public void setVideos(java.util.List<Video> videos)

Sets the Videos for this Playlist.

A list of the Video objects that are encapsulated in this Playlist.

Parameters:
videos - Videos for this Playlist

setPlaylistType

public void setPlaylistType(PlaylistTypeEnum playlistType)

Sets the type for this Playlist.

Options are OLDEST_TO_NEWEST, NEWEST_TO_OLDEST, ALPHABETICAL, PLAYSTOTAL, and PLAYS_TRAILING_WEEK (each of which is a smart playlist, ordered as indicated) or EXPLICIT (a manual playlist). The playlistType is a required property when you create a playlist.

Parameters:
playlistType - Type for this Playlist

setFilterTags

public void setFilterTags(java.util.List<java.lang.String> filterTags)

Sets the filter tags for this Playlist.

A list of the tags that define this smart playlist. For example:

"filterTags":["Sitka","ticks"]

Parameters:
filterTags - Filter tags for this Playlist

setThumbnailUrl

public void setThumbnailUrl(java.lang.String thumbnailUrl)

Sets the thumbnail URL for this Playlist.

The URL of the thumbnail associated with this Playlist.

Parameters:
thumbnailUrl - Thumbnail URL for this Playlist

toJson

public JSONObject toJson()
                  throws JSONException

Converts the video into a JSON object suitable for use with the Media API

Returns:
JSON object representing the video
Throws:
JSONException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object