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

Builder()

Creates a new Builder object.

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.

Program.Builder setEventId(int eventId)

Sets the event ID for this program.

Program.Builder setGlobalContentId(String globalContentId)

Sets the global content ID for this program.

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.

T extends Builder setSeriesId(String seriesId)

Sets the series ID for this program.

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

Builder

public Builder ()

Creates a new Builder object.

Builder

public 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.

setEventId

public Program.Builder setEventId (int eventId)

Sets the event ID for this program.

No-op on devices prior to Build.VERSION_CODES.R.

Parameters
eventId int: The value of TvContractCompat.Programs.COLUMN_EVENT_ID for the program.

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

setGlobalContentId

public Program.Builder setGlobalContentId (String globalContentId)

Sets the global content ID for this program.

No-op on devices prior to Build.VERSION_CODES.R.

Parameters
globalContentId String: The value of TvContractCompat.Programs.COLUMN_GLOBAL_CONTENT_ID for the program.

Returns
Program.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