public abstract class

BaseProgram.Builder<T extends BaseProgram.Builder>

extends java.lang.Object

 java.lang.Object

↳androidx.tvprovider.media.tv.BaseProgram.Builder<T>

Subclasses:

WatchNextProgram.Builder, Program.Builder, BasePreviewProgram.Builder<T>, PreviewProgram.Builder

Overview

This Builder class simplifies the creation of a BaseProgram object.

Summary

Fields
protected ContentValuesmValues

Constructors
publicBuilder()

Creates a new Builder object.

publicBuilder(BaseProgram other)

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

Methods
public BaseProgram.Builder<T>setAudioLanguages(java.lang.String audioLanguages[])

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

public BaseProgram.Builder<T>setCanonicalGenres(java.lang.String genres[])

Sets the genres of the program.

public BaseProgram.Builder<T>setContentRatings(TvContentRating contentRatings[])

Sets the content ratings for this program.

public BaseProgram.Builder<T>setDescription(java.lang.String description)

Sets a brief description of the program.

public BaseProgram.Builder<T>setEpisodeNumber(int episodeNumber)

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

public BaseProgram.Builder<T>setEpisodeNumber(java.lang.String episodeNumber, int numericalEpisodeNumber)

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

public BaseProgram.Builder<T>setEpisodeTitle(java.lang.String episodeTitle)

Sets the title of this particular episode for a series.

public BaseProgram.Builder<T>setId(long programId)

Sets a unique id for this program.

public BaseProgram.Builder<T>setInternalProviderData(byte[] data[])

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

public BaseProgram.Builder<T>setInternalProviderFlag1(long flag)

Sets the internal provider flag1 for the program.

public BaseProgram.Builder<T>setInternalProviderFlag2(long flag)

Sets the internal provider flag2 for the program.

public BaseProgram.Builder<T>setInternalProviderFlag3(long flag)

Sets the internal provider flag3 for the program.

public BaseProgram.Builder<T>setInternalProviderFlag4(long flag)

Sets the internal provider flag4 for the program.

public BaseProgram.Builder<T>setLongDescription(java.lang.String longDescription)

Sets a longer description of a program if one exists.

public BaseProgram.Builder<T>setPackageName(java.lang.String packageName)

Sets the package name for this program.

public BaseProgram.Builder<T>setPosterArtUri(Uri posterArtUri)

Sets the large poster art of the program.

public BaseProgram.Builder<T>setReviewRating(java.lang.String reviewRating)

Sets the review rating score for this program.

public BaseProgram.Builder<T>setReviewRatingStyle(int reviewRatingStyle)

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

public BaseProgram.Builder<T>setSearchable(boolean searchable)

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

public BaseProgram.Builder<T>setSeasonNumber(int seasonNumber)

Sets the season number for this episode for a series.

public BaseProgram.Builder<T>setSeasonNumber(java.lang.String seasonNumber, int numericalSeasonNumber)

Sets the season number for this episode for a series.

public BaseProgram.Builder<T>setSeasonTitle(java.lang.String seasonTitle)

Sets a custom name for the season, if applicable.

public BaseProgram.Builder<T>setSeriesId(java.lang.String seriesId)

Sets the series ID for this program.

public BaseProgram.Builder<T>setThumbnailUri(Uri thumbnailUri)

Sets a small thumbnail of the program.

public BaseProgram.Builder<T>setTitle(java.lang.String title)

Sets the title of this program.

public BaseProgram.Builder<T>setVideoHeight(int height)

Sets the video height of the program.

public BaseProgram.Builder<T>setVideoWidth(int width)

Sets the video width of the program.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

protected ContentValues mValues

Constructors

public Builder()

Creates a new Builder object.

public Builder(BaseProgram other)

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

Parameters:

other: The Program you're copying from.

Methods

public BaseProgram.Builder<T> setId(long programId)

Sets a unique id for this program.

Parameters:

programId: The ID for the program.

Returns:

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

See also: TvContractCompat.BaseTvColumns

public BaseProgram.Builder<T> setPackageName(java.lang.String packageName)

Sets the package name for this program.

Parameters:

packageName: The package name for the program.

Returns:

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

See also: TvContractCompat.BaseTvColumns.COLUMN_PACKAGE_NAME

public BaseProgram.Builder<T> setTitle(java.lang.String title)

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

Parameters:

title: The title for the program.

Returns:

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

See also: COLUMN_TITLE

public BaseProgram.Builder<T> setEpisodeTitle(java.lang.String episodeTitle)

Sets the title of this particular episode for a series.

Parameters:

episodeTitle: The episode title for the program.

Returns:

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

See also: COLUMN_EPISODE_TITLE

public BaseProgram.Builder<T> setSeasonNumber(int seasonNumber)

Sets the season number for this episode for a series.

Parameters:

seasonNumber: The season display number for the program.

Returns:

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

See also: COLUMN_SEASON_DISPLAY_NUMBER

public BaseProgram.Builder<T> setSeasonNumber(java.lang.String seasonNumber, int numericalSeasonNumber)

Sets the season number for this episode for a series.

Parameters:

seasonNumber: The season display number for the program.
numericalSeasonNumber: An integer value for TvContractCompat.Programs.COLUMN_SEASON_NUMBER which will be used for API Level 23 and below.

Returns:

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

See also: COLUMN_SEASON_DISPLAY_NUMBER, TvContractCompat.Programs.COLUMN_SEASON_NUMBER

public BaseProgram.Builder<T> setEpisodeNumber(int episodeNumber)

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

Parameters:

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

Returns:

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

See also: COLUMN_EPISODE_DISPLAY_NUMBER

public BaseProgram.Builder<T> setEpisodeNumber(java.lang.String episodeNumber, int numericalEpisodeNumber)

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

Parameters:

episodeNumber: The value of episode display number for the program.
numericalEpisodeNumber: An integer value for TvContractCompat.Programs.COLUMN_EPISODE_NUMBER which will be used for API Level 23 and below.

Returns:

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

See also: COLUMN_EPISODE_DISPLAY_NUMBER, TvContractCompat.Programs.COLUMN_EPISODE_NUMBER

public BaseProgram.Builder<T> setDescription(java.lang.String description)

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

Parameters:

description: The short description for the program.

Returns:

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

See also: COLUMN_SHORT_DESCRIPTION

public BaseProgram.Builder<T> setLongDescription(java.lang.String longDescription)

Sets a longer description of a program if one exists.

Parameters:

longDescription: The long description for the program.

Returns:

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

See also: COLUMN_LONG_DESCRIPTION

public BaseProgram.Builder<T> setVideoWidth(int width)

Sets the video width of the program.

Parameters:

width: The video width for the program.

Returns:

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

See also: COLUMN_VIDEO_WIDTH

public BaseProgram.Builder<T> setVideoHeight(int height)

Sets the video height of the program.

Parameters:

height: The video height for the program.

Returns:

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

See also: COLUMN_VIDEO_HEIGHT

public BaseProgram.Builder<T> setContentRatings(TvContentRating contentRatings[])

Sets the content ratings for this program.

Parameters:

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

Returns:

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

See also: COLUMN_CONTENT_RATING

public BaseProgram.Builder<T> setPosterArtUri(Uri posterArtUri)

Sets the large poster art of the program.

Parameters:

posterArtUri: The poster art URI for the program.

Returns:

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

See also: COLUMN_POSTER_ART_URI

public BaseProgram.Builder<T> setThumbnailUri(Uri thumbnailUri)

Sets a small thumbnail of the program.

Parameters:

thumbnailUri: The thumbnail URI for the program.

Returns:

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

See also: COLUMN_THUMBNAIL_URI

public BaseProgram.Builder<T> setCanonicalGenres(java.lang.String genres[])

Sets the genres of the program.

Parameters:

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

Returns:

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

See also: COLUMN_CANONICAL_GENRE

public BaseProgram.Builder<T> setInternalProviderData(byte[] data[])

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

Parameters:

data: The internal provider data for the program.

Returns:

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

See also: COLUMN_INTERNAL_PROVIDER_DATA

public BaseProgram.Builder<T> setAudioLanguages(java.lang.String audioLanguages[])

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

Parameters:

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:

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

public BaseProgram.Builder<T> setSearchable(boolean searchable)

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

Parameters:

searchable: Whether the program is searchable or not.

Returns:

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

See also: COLUMN_SEARCHABLE

public BaseProgram.Builder<T> setInternalProviderFlag1(long flag)

Sets the internal provider flag1 for the program.

Parameters:

flag: The first internal provider flag for the program.

Returns:

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

See also: COLUMN_INTERNAL_PROVIDER_FLAG1

public BaseProgram.Builder<T> setInternalProviderFlag2(long flag)

Sets the internal provider flag2 for the program.

Parameters:

flag: The second internal provider flag for the program.

Returns:

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

See also: COLUMN_INTERNAL_PROVIDER_FLAG2

public BaseProgram.Builder<T> setInternalProviderFlag3(long flag)

Sets the internal provider flag3 for the program.

Parameters:

flag: The third internal provider flag for the program.

Returns:

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

See also: COLUMN_INTERNAL_PROVIDER_FLAG3

public BaseProgram.Builder<T> setInternalProviderFlag4(long flag)

Sets the internal provider flag4 for the program.

Parameters:

flag: The forth internal provider flag for the program.

Returns:

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

See also: COLUMN_INTERNAL_PROVIDER_FLAG4

public BaseProgram.Builder<T> setReviewRatingStyle(int reviewRatingStyle)

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

Parameters:

reviewRatingStyle: The reviewing rating style for the program.

Returns:

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

See also: COLUMN_REVIEW_RATING_STYLE, REVIEW_RATING_STYLE_STARS, .Programs#REVIEW_RATING_STYLE_THUMBS_UP_DOWN, REVIEW_RATING_STYLE_PERCENTAGE

public BaseProgram.Builder<T> setReviewRating(java.lang.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: The value of the review rating for the program.

Returns:

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

See also: COLUMN_REVIEW_RATING, COLUMN_REVIEW_RATING_STYLE, REVIEW_RATING_STYLE_STARS, .Programs#REVIEW_RATING_STYLE_THUMBS_UP_DOWN, REVIEW_RATING_STYLE_PERCENTAGE

public BaseProgram.Builder<T> setSeasonTitle(java.lang.String seasonTitle)

Sets a custom name for the season, if applicable.

Parameters:

seasonTitle: The season title for the program.

Returns:

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

See also: COLUMN_SEASON_TITLE

public BaseProgram.Builder<T> setSeriesId(java.lang.String seriesId)

Sets the series ID for this program.

Parameters:

seriesId: The series ID for the program.

Returns:

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

See also: COLUMN_SERIES_ID