Program.Builder

public static class Program.Builder
extends Object

java.lang.Object
   ↳ androidx.tvprovider.media.tv.Program.Builder


This Builder class simplifies the creation of a Program object.

Summary

Public constructors

Program.Builder()

Creates a new Builder object.

Program.Builder(Program other)

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

Public methods

Program build()
T extends Builder setAudioLanguages(String[] audioLanguages)

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

Program.Builder setBroadcastGenres(String[] genres)

Sets the broadcast-specified genres of the program.

T extends Builder setCanonicalGenres(String[] genres)

Sets the genres of the program.

Program.Builder setChannelId(long channelId)

Sets the ID of the Channel that contains this program.

T extends Builder setContentRatings(TvContentRating[] contentRatings)

Sets the content ratings for this program.

T extends Builder setDescription(String description)

Sets a brief description of the program.

Program.Builder setEndTimeUtcMillis(long endTimeUtcMillis)

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

T extends Builder setEpisodeNumber(int episodeNumber)

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

T extends Builder setEpisodeNumber(String episodeNumber, int numericalEpisodeNumber)

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

T extends Builder setEpisodeTitle(String episodeTitle)

Sets the title of this particular episode for a series.

T extends Builder setId(long programId)

Sets a unique id for this program.

T extends Builder setInternalProviderData(byte[] data)

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

T extends Builder setInternalProviderFlag1(long flag)

Sets the internal provider flag1 for the program.

T extends Builder setInternalProviderFlag2(long flag)

Sets the internal provider flag2 for the program.

T extends Builder setInternalProviderFlag3(long flag)

Sets the internal provider flag3 for the program.

T extends Builder setInternalProviderFlag4(long flag)

Sets the internal provider flag4 for the program.

T extends Builder setLongDescription(String longDescription)

Sets a longer description of a program if one exists.

T extends Builder setPosterArtUri(Uri posterArtUri)

Sets the large poster art of the program.

Program.Builder setRecordingProhibited(boolean prohibited)

Sets whether this program cannot be recorded.

T extends Builder setReviewRating(String reviewRating)

Sets the review rating score for this program.

T extends Builder setReviewRatingStyle(int reviewRatingStyle)

Sets the review rating score style used for setReviewRating(String).

T extends Builder setSearchable(boolean searchable)

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

T extends Builder setSeasonNumber(String seasonNumber, int numericalSeasonNumber)

Sets the season number for this episode for a series.

T extends Builder setSeasonNumber(int seasonNumber)

Sets the season number for this episode for a series.

T extends Builder setSeasonTitle(String seasonTitle)

Sets a custom name for the season, if applicable.

Program.Builder setStartTimeUtcMillis(long startTimeUtcMillis)

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

T extends Builder setThumbnailUri(Uri thumbnailUri)

Sets a small thumbnail of the program.

T extends Builder setTitle(String title)

Sets the title of this program.

T extends Builder setVideoHeight(int height)

Sets the video height of the program.

T extends Builder setVideoWidth(int width)

Sets the video width of the program.

Inherited methods

Public constructors

Program.Builder

public Program.Builder ()

Creates a new Builder object.

Program.Builder

public Program.Builder (Program other)

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

Parameters
other Program: The Program you're copying from.

Public methods

build

public Program build ()

Returns
Program A new Program with values supplied by the Builder.

setAudioLanguages

public T extends Builder setAudioLanguages (String[] audioLanguages)

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

Parameters
audioLanguages String: 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 extends Builder This Builder object to allow for chaining of calls to builder methods.

setBroadcastGenres

public Program.Builder setBroadcastGenres (String[] genres)

Sets the broadcast-specified genres of the program.

Parameters
genres String: Array of genres that apply to the program based on the broadcast standard which will be flattened to a String to store in a database.

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

setCanonicalGenres

public T extends Builder setCanonicalGenres (String[] genres)

Sets the genres of the program.

Parameters
genres String: An array of TvContractCompat.Programs.Genres that apply to the program which will be flattened to a String to store in a database.

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

setChannelId

public Program.Builder setChannelId (long channelId)

Sets the ID of the Channel that contains this program.

Parameters
channelId long: The value of {@link Programs#COLUMN_CHANNEL_ID for the program.

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

setContentRatings

public T extends Builder setContentRatings (TvContentRating[] contentRatings)

Sets the content ratings for this program.

Parameters
contentRatings TvContentRating: An array of TvContentRating that apply to this program which will be flattened to a String to store in a database.

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

setDescription

public T extends Builder setDescription (String description)

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

Parameters
description String: The short description for the program.

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

setEndTimeUtcMillis

public Program.Builder setEndTimeUtcMillis (long endTimeUtcMillis)

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

Parameters
endTimeUtcMillis long: The value of TvContractCompat.Programs.COLUMN_END_TIME_UTC_MILLIS for the program.

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

setEpisodeNumber

public T extends Builder setEpisodeNumber (int episodeNumber)

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

Parameters
episodeNumber int: The value of episode display number for the program.

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

setEpisodeNumber

public T extends Builder setEpisodeNumber (String episodeNumber, 
                int numericalEpisodeNumber)

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

Parameters
episodeNumber String: The value of episode display number for the program.

numericalEpisodeNumber int: An integer value for TvContractCompat.Programs.COLUMN_EPISODE_NUMBER which will be used for API Level 23 and below.

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

setEpisodeTitle

public T extends Builder setEpisodeTitle (String episodeTitle)

Sets the title of this particular episode for a series.

Parameters
episodeTitle String: The episode title for the program.

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

setId

public T extends Builder setId (long programId)

Sets a unique id for this program.

Parameters
programId long: The ID for the program.

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

See also:

setInternalProviderData

public T extends Builder setInternalProviderData (byte[] data)

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

Parameters
data byte: The internal provider data for the program.

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

setInternalProviderFlag1

public T extends Builder setInternalProviderFlag1 (long flag)

Sets the internal provider flag1 for the program.

Parameters
flag long: The first internal provider flag for the program.

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

setInternalProviderFlag2

public T extends Builder setInternalProviderFlag2 (long flag)

Sets the internal provider flag2 for the program.

Parameters
flag long: The second internal provider flag for the program.

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

setInternalProviderFlag3

public T extends Builder setInternalProviderFlag3 (long flag)

Sets the internal provider flag3 for the program.

Parameters
flag long: The third internal provider flag for the program.

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

setInternalProviderFlag4

public T extends Builder setInternalProviderFlag4 (long flag)

Sets the internal provider flag4 for the program.

Parameters
flag long: The forth internal provider flag for the program.

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

setLongDescription

public T extends Builder setLongDescription (String longDescription)

Sets a longer description of a program if one exists.

Parameters
longDescription String: The long description for the program.

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

setPosterArtUri

public T extends Builder setPosterArtUri (Uri posterArtUri)

Sets the large poster art of the program.

Parameters
posterArtUri Uri: The poster art URI for the program.

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

setRecordingProhibited

public Program.Builder setRecordingProhibited (boolean prohibited)

Sets whether this program cannot be recorded.

Parameters
prohibited boolean: The value of TvContractCompat.Programs.COLUMN_RECORDING_PROHIBITED for the program.

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

setReviewRating

public T extends Builder 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
reviewRating String: The value of the review rating for the program.

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

setReviewRatingStyle

public T extends Builder setReviewRatingStyle (int reviewRatingStyle)

Sets the review rating score style used for setReviewRating(String).

Parameters
reviewRatingStyle int: The reviewing rating style for the program.

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

setSearchable

public T extends Builder setSearchable (boolean searchable)

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

Parameters
searchable boolean: Whether the program is searchable or not.

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

setSeasonNumber

public T extends Builder setSeasonNumber (String seasonNumber, 
                int numericalSeasonNumber)

Sets the season number for this episode for a series.

Parameters
seasonNumber String: The season display number for the program.

numericalSeasonNumber int: An integer value for TvContractCompat.Programs.COLUMN_SEASON_NUMBER which will be used for API Level 23 and below.

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

setSeasonNumber

public T extends Builder setSeasonNumber (int seasonNumber)

Sets the season number for this episode for a series.

Parameters
seasonNumber int: The season display number for the program.

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

setSeasonTitle

public T extends Builder setSeasonTitle (String seasonTitle)

Sets a custom name for the season, if applicable.

Parameters
seasonTitle String: The season title for the program.

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

setStartTimeUtcMillis

public Program.Builder setStartTimeUtcMillis (long startTimeUtcMillis)

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

Parameters
startTimeUtcMillis long: The value of TvContractCompat.Programs.COLUMN_START_TIME_UTC_MILLIS for the program.

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

setThumbnailUri

public T extends Builder setThumbnailUri (Uri thumbnailUri)

Sets a small thumbnail of the program.

Parameters
thumbnailUri Uri: The thumbnail URI for the program.

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

setTitle

public T extends Builder setTitle (String title)

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

Parameters
title String: The title for the program.

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

setVideoHeight

public T extends Builder setVideoHeight (int height)

Sets the video height of the program.

Parameters
height int: The video height for the program.

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

setVideoWidth

public T extends Builder setVideoWidth (int width)

Sets the video width of the program.

Parameters
width int: The video width for the program.

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