WatchNextProgram.Builder

public final class WatchNextProgram.Builder


This Builder class simplifies the creation of a WatchNextProgram object.

Summary

Public constructors

Creates a new Builder object.

Creates a new Builder object with values copied from another Program.

Public methods

WatchNextProgram
T
setAudioLanguages(String[] audioLanguages)

Sets the available audio languages for this program as an array of strings.

T
setAuthor(String author)

Sets the author or artist of this content.

T
setAvailability(int availability)

Sets the availability of this TV program.

T
setCanonicalGenres(String[] genres)

Sets the genres of the program.

T
setContentId(String contentId)

Sets the content ID for this program.

T
setContentRatings(TvContentRating[] contentRatings)

Sets the content ratings for this program.

T
setDescription(String description)

Sets a brief description of the program.

T
setDurationMillis(int duration)

Sets the last playback duration (in milliseconds) of the preview video.

T
setEndTimeUtcMillis(long endTime)

Sets the end time of the program (for live programs).

T
setEpisodeNumber(int episodeNumber)

Sets the episode number in a season for this episode for a series.

T
setEpisodeNumber(String episodeNumber, int numericalEpisodeNumber)

Sets the episode number in a season for this episode for a series.

T
setEpisodeTitle(String episodeTitle)

Sets the title of this particular episode for a series.

T

Sets the genre for this program.

T
setId(long programId)

Sets a unique id for this program.

T
setIntent(Intent intent)

Sets the intent which is launched when the program is selected.

T
setIntentUri(Uri intentUri)

Sets the intent URI which is launched when the program is selected.

T
setInteractionCount(long interactionCount)

Sets the interaction count for this program.

T
setInteractionType(int interactionType)

Sets the type of interaction for this TV program.

T

Sets the internal provider data for the program as raw bytes.

T

Sets the internal provider flag1 for the program.

T

Sets the internal provider flag2 for the program.

T

Sets the internal provider flag3 for the program.

T

Sets the internal provider flag4 for the program.

T

Sets external ID for the program.

T
setItemCount(int itemCount)

Sets the count of the items included in this TV program.

WatchNextProgram.Builder
setLastEngagementTimeUtcMillis(long lastEngagementTimeUtcMillis)

Sets the time when the program is going to begin in milliseconds since the epoch.

T

Sets the last playback position (in milliseconds) of the preview video.

T
setLive(boolean live)

Sets whether this TV program is live or not.

T
setLogoContentDescription(String logoContentDescription)

Sets the logo's content description for this program.

T
setLogoUri(Uri logoUri)

Sets the URI for the logo of this TV program.

T
setLongDescription(String longDescription)

Sets a longer description of a program if one exists.

T

Sets the offer price of this TV program.

T

Sets the aspect ratio of the poster art for this TV program.

T
setPosterArtUri(Uri posterArtUri)

Sets the large poster art of the program.

T
setPreviewAudioUri(Uri previewAudioUri)

Sets a URI for the preview audio.

T
setPreviewVideoUri(Uri previewVideoUri)

Sets a URI for the preview video.

T
setReleaseDate(Date releaseDate)

Sets the release date of this TV program.

T
setReleaseDate(String releaseDate)

Sets the release date of this TV program.

T
setReviewRating(String reviewRating)

Sets the review rating score for this program.

T
setReviewRatingStyle(int reviewRatingStyle)

Sets the review rating score style used for setReviewRating.

T
setSearchable(boolean searchable)

Sets whether this channel can be searched for in other applications.

T
setSeasonNumber(int seasonNumber)

Sets the season number for this episode for a series.

T
setSeasonNumber(String seasonNumber, int numericalSeasonNumber)

Sets the season number for this episode for a series.

T
setSeasonTitle(String seasonTitle)

Sets a custom name for the season, if applicable.

@NonNull T

Sets the series ID for this program.

T
setStartTimeUtcMillis(long startTime)

Sets the start time of the program (for live programs).

T

Sets the starting price of this TV program.

T

Sets the aspect ratio of the thumbnail for this TV program.

T
setThumbnailUri(Uri thumbnailUri)

Sets a small thumbnail of the program.

T

Sets the title of this program.

T
setTransient(boolean transientValue)

Sets whether this program is transient or not.

T

Set the TV series item type for this program.

T
setType(int type)

Sets the type of this program content.

T
setVideoHeight(int height)

Sets the video height of the program.

T
setVideoWidth(int width)

Sets the video width of the program.

WatchNextProgram.Builder
setWatchNextType(int watchNextType)

Sets the "watch next" type of this program content.

Public constructors

Builder

Added in 1.1.0-alpha02
public Builder()

Creates a new Builder object.

Builder

Added in 1.1.0-alpha02
public Builder(WatchNextProgram other)

Creates a new Builder object with values copied from another Program.

Parameters
WatchNextProgram other

The Program you're copying from.

Public methods

build

Added in 1.1.0-alpha02
public WatchNextProgram build()
Returns
WatchNextProgram

A new Program with values supplied by the Builder.

setAudioLanguages

Added in 1.1.0-alpha02
public T setAudioLanguages(String[] audioLanguages)

Sets the available audio languages for this program as an array of strings.

Parameters
String[] audioLanguages

An array of audio languages, in ISO 639-1 or 639-2/T codes, that apply to this program which will be stored in a database.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setAuthor

Added in 1.1.0-alpha02
public T setAuthor(String author)

Sets the author or artist of this content.

Parameters
String author

The author of the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

See also
COLUMN_AUTHOR

setAvailability

Added in 1.1.0-alpha02
public T setAvailability(int availability)

Sets the availability of this TV program.

The value should match one of the followings: .PreviewPrograms#AVAILABILITY_AVAILABLE, .PreviewPrograms#AVAILABILITY_FREE_WITH_SUBSCRIPTION, .PreviewPrograms#AVAILABILITY_PAID_CONTENT, .PreviewPrograms#AVAILABILITY_PURCHASED, and .PreviewPrograms#AVAILABILITY_FREE.

Parameters
int availability

The availability of the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setCanonicalGenres

Added in 1.1.0-alpha02
public T setCanonicalGenres(String[] genres)

Sets the genres of the program.

Parameters
String[] genres

An array of androidx.tvprovider.media.tv.TvContractCompat.Programs.Genres that apply to the program which will be flattened to a String to store in a database.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setContentId

Added in 1.1.0-alpha02
public T setContentId(String contentId)

Sets the content ID for this program.

Parameters
String contentId

The content ID for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setContentRatings

Added in 1.1.0-alpha02
public T setContentRatings(TvContentRating[] contentRatings)

Sets the content ratings for this program.

Parameters
TvContentRating[] contentRatings

An array of android.media.tv.TvContentRating that apply to this program which will be flattened to a String to store in a database.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setDescription

Added in 1.1.0-alpha02
public T setDescription(String description)

Sets a brief description of the program. For a series, this would be a brief description of the episode.

Parameters
String description

The short description for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setDurationMillis

Added in 1.1.0-alpha02
public T setDurationMillis(int duration)

Sets the last playback duration (in milliseconds) of the preview video.

Parameters
int duration

The duration the program in millis.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setEndTimeUtcMillis

Added in 1.1.0-alpha02
public T setEndTimeUtcMillis(long endTime)

Sets the end time of the program (for live programs).

Parameters
long endTime

The end time for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setEpisodeNumber

Added in 1.1.0-alpha02
public T setEpisodeNumber(int episodeNumber)

Sets the episode number in a season for this episode for a series.

Parameters
int episodeNumber

The value of episode display number for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setEpisodeNumber

Added in 1.1.0-alpha02
public T setEpisodeNumber(String episodeNumber, int numericalEpisodeNumber)

Sets the episode number in a season for this episode for a series.

Parameters
String episodeNumber

The value of episode display number for the program.

int numericalEpisodeNumber

An integer value for COLUMN_EPISODE_NUMBER which will be used for API Level 23 and below.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setEpisodeTitle

Added in 1.1.0-alpha02
public T setEpisodeTitle(String episodeTitle)

Sets the title of this particular episode for a series.

Parameters
String episodeTitle

The episode title for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setGenre

Added in 1.1.0-alpha02
public T setGenre(String genre)

Sets the genre for this program.

Parameters
String genre

The genre for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

See also
COLUMN_GENRE

setId

Added in 1.1.0-alpha02
public T setId(long programId)

Sets a unique id for this program.

Parameters
long programId

The ID for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

See also
_ID

setIntent

Added in 1.1.0-alpha02
public T setIntent(Intent intent)

Sets the intent which is launched when the program is selected.

Parameters
Intent intent

The Intent to be executed when the preview program is selected

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setIntentUri

Added in 1.1.0-alpha02
public T setIntentUri(Uri intentUri)

Sets the intent URI which is launched when the program is selected.

Parameters
Uri intentUri

The intent URI for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setInteractionCount

Added in 1.1.0-alpha02
public T setInteractionCount(long interactionCount)

Sets the interaction count for this program.

Parameters
long interactionCount

The interaction count for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setInteractionType

Added in 1.1.0-alpha02
public T setInteractionType(int interactionType)

Sets the type of interaction for this TV program.

The value should match one of the followings: .PreviewPrograms#INTERACTION_TYPE_LISTENS, .PreviewPrograms#INTERACTION_TYPE_FOLLOWERS, INTERACTION_TYPE_FANS, INTERACTION_TYPE_LIKES, .PreviewPrograms#INTERACTION_TYPE_THUMBS, INTERACTION_TYPE_VIEWS, and .PreviewPrograms#INTERACTION_TYPE_VIEWERS.

Parameters
int interactionType

The interaction type of the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setInternalProviderData

Added in 1.1.0-alpha02
public T setInternalProviderData(byte[] data)

Sets the internal provider data for the program as raw bytes.

Parameters
byte[] data

The internal provider data for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setInternalProviderFlag1

Added in 1.1.0-alpha02
public T setInternalProviderFlag1(long flag)

Sets the internal provider flag1 for the program.

Parameters
long flag

The first internal provider flag for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setInternalProviderFlag2

Added in 1.1.0-alpha02
public T setInternalProviderFlag2(long flag)

Sets the internal provider flag2 for the program.

Parameters
long flag

The second internal provider flag for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setInternalProviderFlag3

Added in 1.1.0-alpha02
public T setInternalProviderFlag3(long flag)

Sets the internal provider flag3 for the program.

Parameters
long flag

The third internal provider flag for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setInternalProviderFlag4

Added in 1.1.0-alpha02
public T setInternalProviderFlag4(long flag)

Sets the internal provider flag4 for the program.

Parameters
long flag

The forth internal provider flag for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setInternalProviderId

Added in 1.1.0-alpha02
public T setInternalProviderId(String externalId)

Sets external ID for the program.

Parameters
String externalId

The internal provider ID for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

See also
TvContractCompat

.PreviewPrograms#COLUMN_INTERNAL_PROVIDER_ID

setItemCount

Added in 1.1.0-alpha02
public T setItemCount(int itemCount)

Sets the count of the items included in this TV program.

Parameters
int itemCount

The item count for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setLastEngagementTimeUtcMillis

Added in 1.1.0-alpha02
public WatchNextProgram.Builder setLastEngagementTimeUtcMillis(long lastEngagementTimeUtcMillis)

Sets the time when the program is going to begin in milliseconds since the epoch.

Parameters
long lastEngagementTimeUtcMillis

The value of COLUMN_LAST_ENGAGEMENT_TIME_UTC_MILLIS for the program.

Returns
WatchNextProgram.Builder

This Builder object to allow for chaining of calls to builder methods.

setLastPlaybackPositionMillis

Added in 1.1.0-alpha02
public T setLastPlaybackPositionMillis(int position)

Sets the last playback position (in milliseconds) of the preview video.

Parameters
int position

The last playback posirion for the program in millis.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

See also
TvContractCompat

.PreviewPrograms#COLUMN_LAST_PLAYBACK_POSITION_MILLIS

setLive

Added in 1.1.0-alpha02
public T setLive(boolean live)

Sets whether this TV program is live or not.

Parameters
boolean live

Whether the program is live or not.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

See also
COLUMN_LIVE

setLogoContentDescription

Added in 1.1.0-alpha02
public T setLogoContentDescription(String logoContentDescription)

Sets the logo's content description for this program.

Parameters
String logoContentDescription

The content description for the logo displayed in the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

See also
TvContractCompat

.PreviewPrograms#COLUMN_LOGO_CONTENT_DESCRIPTION

COLUMN_LOGO_URI

setLogoUri

Added in 1.1.0-alpha02
public T setLogoUri(Uri logoUri)

Sets the URI for the logo of this TV program.

Parameters
Uri logoUri

The logo URI for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

See also
COLUMN_LOGO_URI

setLongDescription

Added in 1.1.0-alpha02
public T setLongDescription(String longDescription)

Sets a longer description of a program if one exists.

Parameters
String longDescription

The long description for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setOfferPrice

Added in 1.1.0-alpha02
public T setOfferPrice(String price)

Sets the offer price of this TV program.

Parameters
String price

The offer price of the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setPosterArtAspectRatio

Added in 1.1.0-alpha02
public T setPosterArtAspectRatio(int ratio)

Sets the aspect ratio of the poster art for this TV program.

The value should match one of the followings: ASPECT_RATIO_16_9, ASPECT_RATIO_3_2, ASPECT_RATIO_4_3, ASPECT_RATIO_1_1, ASPECT_RATIO_2_3, and .PreviewPrograms#ASPECT_RATIO_MOVIE_POSTER.

Parameters
int ratio

The poster art aspect ratio for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

See also
TvContractCompat

.PreviewPrograms#COLUMN_POSTER_ART_ASPECT_RATIO

COLUMN_POSTER_ART_URI

setPosterArtUri

Added in 1.1.0-alpha02
public T setPosterArtUri(Uri posterArtUri)

Sets the large poster art of the program.

Parameters
Uri posterArtUri

The poster art URI for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setPreviewAudioUri

Added in 1.1.0-alpha02
public T setPreviewAudioUri(Uri previewAudioUri)

Sets a URI for the preview audio.

Parameters
Uri previewAudioUri

The preview audio URI for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setPreviewVideoUri

Added in 1.1.0-alpha02
public T setPreviewVideoUri(Uri previewVideoUri)

Sets a URI for the preview video.

Parameters
Uri previewVideoUri

The preview video URI for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setReleaseDate

Added in 1.1.0-alpha02
public T setReleaseDate(Date releaseDate)

Sets the release date of this TV program.

Parameters
Date releaseDate

The release date of the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setReleaseDate

Added in 1.1.0-alpha02
public T setReleaseDate(String releaseDate)

Sets the release date of this TV program.

The value should be in one of the following formats: "yyyy", "yyyy-MM-dd", and "yyyy-MM-ddTHH:mm:ssZ" (UTC in ISO 8601).

Parameters
String releaseDate

The release date of the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setReviewRating

Added in 1.1.0-alpha02
public T setReviewRating(String reviewRating)

Sets the review rating score for this program.

The format of the value is dependent on the review rating style. If the style is based on "stars", the value should be a real number between 0.0 and 5.0. (e.g. "4.5") If the style is based on "thumbs up/down", the value should be two integers, one for thumbs-up count and the other for thumbs-down count, with a comma between them. (e.g. "200,40") If the style is base on "percentage", the value should be a real number between 0 and 100. (e.g. "99.9")

Parameters
String reviewRating

The value of the review rating for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setReviewRatingStyle

Added in 1.1.0-alpha02
public T setReviewRatingStyle(int reviewRatingStyle)

Sets the review rating score style used for setReviewRating.

Parameters
int reviewRatingStyle

The reviewing rating style for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setSearchable

Added in 1.1.0-alpha02
public T setSearchable(boolean searchable)

Sets whether this channel can be searched for in other applications.

Parameters
boolean searchable

Whether the program is searchable or not.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setSeasonNumber

Added in 1.1.0-alpha02
public T setSeasonNumber(int seasonNumber)

Sets the season number for this episode for a series.

Parameters
int seasonNumber

The season display number for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setSeasonNumber

Added in 1.1.0-alpha02
public T setSeasonNumber(String seasonNumber, int numericalSeasonNumber)

Sets the season number for this episode for a series.

Parameters
String seasonNumber

The season display number for the program.

int numericalSeasonNumber

An integer value for COLUMN_SEASON_NUMBER which will be used for API Level 23 and below.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setSeasonTitle

Added in 1.1.0-alpha02
public T setSeasonTitle(String seasonTitle)

Sets a custom name for the season, if applicable.

Parameters
String seasonTitle

The season title for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setSeriesId

Added in 1.1.0-alpha02
public @NonNullsetSeriesId(@Nullable String seriesId)

Sets the series ID for this program.

Parameters
@Nullable String seriesId

The series ID for the program.

Returns
@NonNull T

This Builder object to allow for chaining of calls to builder methods.

See also
COLUMN_SERIES_ID

setStartTimeUtcMillis

Added in 1.1.0-alpha02
public T setStartTimeUtcMillis(long startTime)

Sets the start time of the program (for live programs).

Parameters
long startTime

The start time for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

See also
TvContractCompat

.PreviewPrograms#COLUMN_START_TIME_UTC_MILLIS

setStartingPrice

Added in 1.1.0-alpha02
public T setStartingPrice(String price)

Sets the starting price of this TV program.

Parameters
String price

The starting price of the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setThumbnailAspectRatio

Added in 1.1.0-alpha02
public T setThumbnailAspectRatio(int ratio)

Sets the aspect ratio of the thumbnail for this TV program.

The value should match one of the followings: ASPECT_RATIO_16_9, ASPECT_RATIO_3_2, ASPECT_RATIO_4_3, ASPECT_RATIO_1_1, ASPECT_RATIO_2_3, and .PreviewPrograms#ASPECT_RATIO_MOVIE_POSTER.

Parameters
int ratio

The thumbnail aspect ratio of the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

See also
TvContractCompat

.PreviewPrograms#COLUMN_THUMBNAIL_ASPECT_RATIO

setThumbnailUri

Added in 1.1.0-alpha02
public T setThumbnailUri(Uri thumbnailUri)

Sets a small thumbnail of the program.

Parameters
Uri thumbnailUri

The thumbnail URI for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setTitle

Added in 1.1.0-alpha02
public T setTitle(String title)

Sets the title of this program. For a series, this is the series title.

Parameters
String title

The title for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

See also
COLUMN_TITLE

setTransient

Added in 1.1.0-alpha02
public T setTransient(boolean transientValue)

Sets whether this program is transient or not.

Parameters
boolean transientValue

Whether the program is transient or not.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

See also
COLUMN_TRANSIENT

setTvSeriesItemType

Added in 1.1.0-alpha02
public T setTvSeriesItemType(int type)

Set the TV series item type for this program.

Parameters
int type

the TV series item type

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setType

Added in 1.1.0-alpha02
public T setType(int type)

Sets the type of this program content.

The value should match one of the followings: TYPE_MOVIE, TYPE_TV_SERIES, TYPE_TV_SEASON, TYPE_TV_EPISODE, TYPE_CLIP, TYPE_EVENT, TYPE_CHANNEL, TYPE_TRACK, TYPE_ALBUM, TYPE_ARTIST, TYPE_PLAYLIST, TYPE_STATION, and TYPE_GAME.

Parameters
int type

The type of the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

See also
COLUMN_TYPE

setVideoHeight

Added in 1.1.0-alpha02
public T setVideoHeight(int height)

Sets the video height of the program.

Parameters
int height

The video height for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setVideoWidth

Added in 1.1.0-alpha02
public T setVideoWidth(int width)

Sets the video width of the program.

Parameters
int width

The video width for the program.

Returns
T

This Builder object to allow for chaining of calls to builder methods.

setWatchNextType

Added in 1.1.0-alpha02
public WatchNextProgram.Builder setWatchNextType(int watchNextType)

Sets the "watch next" type of this program content.

The value should match one of the followings: WATCH_NEXT_TYPE_CONTINUE, WATCH_NEXT_TYPE_NEXT, and WATCH_NEXT_TYPE_NEW.

Parameters
int watchNextType

The value of COLUMN_WATCH_NEXT_TYPE for the program.

Returns
WatchNextProgram.Builder

This Builder object to allow for chaining of calls to builder methods.