Program.Builder

class Program.Builder


This Builder class simplifies the creation of a Program object.

Summary

Public constructors

Creates a new Builder object.

Builder(other: Program!)

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

Public functions

Program!
T!
setAudioLanguages(audioLanguages: Array<String!>!)

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

Program.Builder!

Sets the broadcast-specified genres of the program.

T!

Sets the genres of the program.

Program.Builder!
setChannelId(channelId: Long)

Sets the ID of the Channel that contains this program.

T!

Sets the content ratings for this program.

T!
setDescription(description: String!)

Sets a brief description of the program.

Program.Builder!
setEndTimeUtcMillis(endTimeUtcMillis: Long)

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

T!
setEpisodeNumber(episodeNumber: Int)

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

T!
setEpisodeNumber(episodeNumber: String!, numericalEpisodeNumber: Int)

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

T!
setEpisodeTitle(episodeTitle: String!)

Sets the title of this particular episode for a series.

Program.Builder
setEventId(eventId: Int)

Sets the event ID for this program.

Program.Builder
setGlobalContentId(globalContentId: String?)

Sets the global content ID for this program.

T!
setId(programId: Long)

Sets a unique id for this 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!
setLongDescription(longDescription: String!)

Sets a longer description of a program if one exists.

T!
setPosterArtUri(posterArtUri: Uri!)

Sets the large poster art of the program.

Program.Builder!

Sets whether this program cannot be recorded.

T!
setReviewRating(reviewRating: String!)

Sets the review rating score for this program.

T!
setReviewRatingStyle(reviewRatingStyle: Int)

Sets the review rating score style used for setReviewRating.

T!
setSearchable(searchable: Boolean)

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

T!
setSeasonNumber(seasonNumber: Int)

Sets the season number for this episode for a series.

T!
setSeasonNumber(seasonNumber: String!, numericalSeasonNumber: Int)

Sets the season number for this episode for a series.

T!
setSeasonTitle(seasonTitle: String!)

Sets a custom name for the season, if applicable.

T
setSeriesId(seriesId: String?)

Sets the series ID for this program.

Program.Builder!
setStartTimeUtcMillis(startTimeUtcMillis: Long)

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

T!
setThumbnailUri(thumbnailUri: Uri!)

Sets a small thumbnail of the program.

T!
setTitle(title: String!)

Sets the title of this program.

T!

Sets the video height of the program.

T!

Sets the video width of the program.

Public constructors

Builder

Added in 1.1.0-alpha02
Builder()

Creates a new Builder object.

Builder

Added in 1.1.0-alpha02
Builder(other: Program!)

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

Parameters
other: Program!

The Program you're copying from.

Public functions

build

Added in 1.1.0-alpha02
fun build(): Program!
Returns
Program!

A new Program with values supplied by the Builder.

setAudioLanguages

Added in 1.1.0-alpha02
fun setAudioLanguages(audioLanguages: Array<String!>!): T!

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

Parameters
audioLanguages: Array<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!

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

setBroadcastGenres

Added in 1.1.0-alpha02
fun setBroadcastGenres(genres: Array<String!>!): Program.Builder!

Sets the broadcast-specified genres of the program.

Parameters
genres: Array<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

Added in 1.1.0-alpha02
fun setCanonicalGenres(genres: Array<String!>!): T!

Sets the genres of the program.

Parameters
genres: Array<String!>!

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.

setChannelId

Added in 1.1.0-alpha02
fun setChannelId(channelId: Long): Program.Builder!

Sets the ID of the Channel that contains this program.

setContentRatings

Added in 1.1.0-alpha02
fun setContentRatings(contentRatings: Array<TvContentRating!>!): T!

Sets the content ratings for this program.

Parameters
contentRatings: Array<TvContentRating!>!

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
fun setDescription(description: String!): T!

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!

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

setEndTimeUtcMillis

Added in 1.1.0-alpha02
fun setEndTimeUtcMillis(endTimeUtcMillis: Long): Program.Builder!

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

Parameters
endTimeUtcMillis: Long

The value of COLUMN_END_TIME_UTC_MILLIS for the program.

Returns
Program.Builder!

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

setEpisodeNumber

Added in 1.1.0-alpha02
fun setEpisodeNumber(episodeNumber: Int): T!

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!

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

setEpisodeNumber

Added in 1.1.0-alpha02
fun setEpisodeNumber(episodeNumber: String!, numericalEpisodeNumber: Int): T!

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 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
fun setEpisodeTitle(episodeTitle: String!): T!

Sets the title of this particular episode for a series.

Parameters
episodeTitle: String!

The episode title for the program.

Returns
T!

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

setEventId

Added in 1.1.0-alpha02
fun setEventId(eventId: Int): Program.Builder

Sets the event ID for this program.

No-op on devices prior to R.

Parameters
eventId: Int

The value of COLUMN_EVENT_ID for the program.

Returns
Program.Builder

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

setGlobalContentId

Added in 1.1.0-alpha02
fun setGlobalContentId(globalContentId: String?): Program.Builder

Sets the global content ID for this program.

No-op on devices prior to R.

Parameters
globalContentId: String?

The value of COLUMN_GLOBAL_CONTENT_ID for the program.

Returns
Program.Builder

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

setId

Added in 1.1.0-alpha02
fun setId(programId: Long): T!

Sets a unique id for this program.

Parameters
programId: Long

The ID for the program.

Returns
T!

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

See also
_ID

setInternalProviderData

Added in 1.1.0-alpha02
fun setInternalProviderData(data: ByteArray!): T!

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

Parameters
data: ByteArray!

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
fun setInternalProviderFlag1(flag: Long): T!

Sets the internal provider flag1 for the program.

Parameters
flag: Long

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
fun setInternalProviderFlag2(flag: Long): T!

Sets the internal provider flag2 for the program.

Parameters
flag: Long

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
fun setInternalProviderFlag3(flag: Long): T!

Sets the internal provider flag3 for the program.

Parameters
flag: Long

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
fun setInternalProviderFlag4(flag: Long): T!

Sets the internal provider flag4 for the program.

Parameters
flag: Long

The forth internal provider flag for the program.

Returns
T!

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

setLongDescription

Added in 1.1.0-alpha02
fun setLongDescription(longDescription: String!): T!

Sets a longer description of a program if one exists.

Parameters
longDescription: String!

The long description for the program.

Returns
T!

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

setPosterArtUri

Added in 1.1.0-alpha02
fun setPosterArtUri(posterArtUri: Uri!): T!

Sets the large poster art of the program.

Parameters
posterArtUri: Uri!

The poster art URI for the program.

Returns
T!

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

setRecordingProhibited

Added in 1.1.0-alpha02
fun setRecordingProhibited(prohibited: Boolean): Program.Builder!

Sets whether this program cannot be recorded.

Parameters
prohibited: Boolean

The value of COLUMN_RECORDING_PROHIBITED for the program.

Returns
Program.Builder!

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

setReviewRating

Added in 1.1.0-alpha02
fun setReviewRating(reviewRating: String!): T!

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!

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

setReviewRatingStyle

Added in 1.1.0-alpha02
fun setReviewRatingStyle(reviewRatingStyle: Int): T!

Sets the review rating score style used for setReviewRating.

Parameters
reviewRatingStyle: Int

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
fun setSearchable(searchable: Boolean): T!

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

Parameters
searchable: Boolean

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
fun setSeasonNumber(seasonNumber: Int): T!

Sets the season number for this episode for a series.

Parameters
seasonNumber: Int

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
fun setSeasonNumber(seasonNumber: String!, numericalSeasonNumber: Int): T!

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 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
fun setSeasonTitle(seasonTitle: String!): T!

Sets a custom name for the season, if applicable.

Parameters
seasonTitle: String!

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
fun setSeriesId(seriesId: String?): T

Sets the series ID for this program.

Parameters
seriesId: String?

The series ID for the program.

Returns
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
fun setStartTimeUtcMillis(startTimeUtcMillis: Long): Program.Builder!

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

Parameters
startTimeUtcMillis: Long

The value of COLUMN_START_TIME_UTC_MILLIS for the program.

Returns
Program.Builder!

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

setThumbnailUri

Added in 1.1.0-alpha02
fun setThumbnailUri(thumbnailUri: Uri!): T!

Sets a small thumbnail of the program.

Parameters
thumbnailUri: Uri!

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
fun setTitle(title: String!): T!

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

Parameters
title: String!

The title for the program.

Returns
T!

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

See also
COLUMN_TITLE

setVideoHeight

Added in 1.1.0-alpha02
fun setVideoHeight(height: Int): T!

Sets the video height of the program.

Parameters
height: Int

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
fun setVideoWidth(width: Int): T!

Sets the video width of the program.

Parameters
width: Int

The video width for the program.

Returns
T!

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