Program.Builder


public class Program.Builder


This Builder class simplifies the creation of a Program object.

Summary

Public constructors

Creates a new Builder object.

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

Public methods

Program
Program.Builder
setBroadcastGenres(String[] genres)

Sets the broadcast-specified genres of the program.

Program.Builder
setChannelId(long channelId)

Sets the ID of the Channel that contains this program.

Program.Builder
setEndTimeUtcMillis(long endTimeUtcMillis)

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

@NonNull Program.Builder
setEventId(int eventId)

Sets the event ID for this program.

@NonNull Program.Builder

Sets the global content ID for this program.

Program.Builder
setRecordingProhibited(boolean prohibited)

Sets whether this program cannot be recorded.

Program.Builder
setStartTimeUtcMillis(long startTimeUtcMillis)

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

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(Program other)

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

Parameters
Program other

The Program you're copying from.

Public methods

build

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

A new Program with values supplied by the Builder.

setBroadcastGenres

Added in 1.1.0-alpha02
public Program.Builder setBroadcastGenres(String[] genres)

Sets the broadcast-specified genres of the program.

Parameters
String[] genres

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.

setChannelId

Added in 1.1.0-alpha02
public Program.Builder setChannelId(long channelId)

Sets the ID of the Channel that contains this program.

setEndTimeUtcMillis

Added in 1.1.0-alpha02
public Program.Builder setEndTimeUtcMillis(long endTimeUtcMillis)

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

Parameters
long endTimeUtcMillis

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.

setEventId

Added in 1.1.0-alpha02
public @NonNull Program.Builder setEventId(int eventId)

Sets the event ID for this program.

No-op on devices prior to R.

Parameters
int eventId

The value of COLUMN_EVENT_ID for the program.

Returns
@NonNull Program.Builder

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

setGlobalContentId

Added in 1.1.0-alpha02
public @NonNull Program.Builder setGlobalContentId(@Nullable String globalContentId)

Sets the global content ID for this program.

No-op on devices prior to R.

Parameters
@Nullable String globalContentId

The value of COLUMN_GLOBAL_CONTENT_ID for the program.

Returns
@NonNull Program.Builder

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

setRecordingProhibited

Added in 1.1.0-alpha02
public Program.Builder setRecordingProhibited(boolean prohibited)

Sets whether this program cannot be recorded.

Parameters
boolean prohibited

The value of COLUMN_RECORDING_PROHIBITED for the program.

Returns
Program.Builder

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

setStartTimeUtcMillis

Added in 1.1.0-alpha02
public Program.Builder setStartTimeUtcMillis(long startTimeUtcMillis)

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

Parameters
long startTimeUtcMillis

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.