SportsEvent.BuilderBase


@ExperimentalAppSearchApi
class SportsEvent.BuilderBase<T : SportsEvent.BuilderBase<T!>?> : Event.BuilderBase

Known direct subclasses

Summary

Public constructors

BuilderBase(sportsEvent: SportsEvent)

Constructor for SportsEvent.BuilderBase with all the existing values.

BuilderBase(
    namespace: String,
    id: String,
    startDate: Instant,
    sport: String,
    homeTeam: SportsTeam,
    awayTeam: SportsTeam
)

Constructor for SportsEvent.BuilderBase.

Public functions

SportsEvent

Builds a Thing object.

T
setAwayTeamAccessoryScore(awayTeamAccessoryScore: String?)

Sets the away team accessory score of the sports event.

T
setAwayTeamScore(awayTeamScore: String?)

Sets the away team score of the sports event.

T
setAwayTeamWinProbability(awayTeamWinProbability: Double)

Sets the away team win probability of the sports event.

T
setGameTemporalState(gameTemporalState: String?)

Sets the game temporal state of the sports event.

T
setHomeTeamAccessoryScore(homeTeamAccessoryScore: String?)

Sets the home team accessory score of the sports event.

T
setHomeTeamScore(homeTeamScore: String?)

Sets the home team score of the sports event.

T
setHomeTeamWinProbability(homeTeamWinProbability: Double)

Sets the home team win probability of the sports event.

T
setNotableDetail(notableDetail: String?)

Sets the most recent notable detail of the sports event.

T

Sets the Organization of the sports event.

T
setPlaceHomeTeamAtStart(placeHomeTeamAtStart: Boolean)

Sets whether the home team should be placed at the start for a visual representation of the sports event.

T
setResult(result: Long)

Sets whether the home team won the sports event.

T
setSportsEventStatus(sportsEventStatus: Long)

Sets the status of the sports event.

T
setSportsEventStatusLabel(sportsEventStatusLabel: String?)

Sets the status label of the sports event.

Inherited functions

From androidx.appsearch.builtintypes.Event.BuilderBase
T
setDuration(duration: Duration?)

Sets the duration of the event as a Duration.

T
setEndDate(endDate: Instant?)

Sets the end date of the event as a Instant.

T
setLocation(location: String?)

Sets the location of the event.

T

Sets the logo of the event.

From androidx.appsearch.builtintypes.Thing.BuilderBase
T
addAlternateName(alternateName: String)

Adds an alias for the item.

T

Add a new action to the list of potential actions for this document.

Thing

Builds a Thing object.

T

Clears the aliases, if any, for the item.

T

Clear all the potential actions for this document.

Unit

If built, make a copy of previous data for every field so that the builder can be reused.

T
setAlternateNames(alternateNames: (Mutable)List<String!>?)

Sets a list of aliases for the item.

T
setCreationTimestampMillis(creationTimestampMillis: Long)

Sets the creation timestamp for the current AppSearch entity, in milliseconds using the currentTimeMillis time base.

T
setDescription(description: String?)

Sets the description for the item.

T
setDocumentScore(documentScore: Int)

Sets the user-provided opaque document score of the current AppSearch document, which can be used for ranking using RANKING_STRATEGY_DOCUMENT_SCORE.

T
setDocumentTtlMillis(documentTtlMillis: Long)

Sets the time-to-live (TTL) for the current AppSearch document as a duration in milliseconds.

T

Sets the URL for an image of the item.

T
setName(name: String?)

Sets the name of the item.

T

Sets a list of potential actions for this document.

T
setUrl(url: String?)

Sets the deeplink URL of the item.

Public constructors

BuilderBase

Added in 1.2.0-alpha02
BuilderBase(sportsEvent: SportsEvent)

Constructor for SportsEvent.BuilderBase with all the existing values.

Parameters
sportsEvent: SportsEvent

The existing SportsEvent to copy values from.

BuilderBase

Added in 1.2.0-alpha02
BuilderBase(
    namespace: String,
    id: String,
    startDate: Instant,
    sport: String,
    homeTeam: SportsTeam,
    awayTeam: SportsTeam
)

Constructor for SportsEvent.BuilderBase.

Parameters
namespace: String

Namespace for the Document. See Document.Namespace.

id: String

Unique identifier for the Document. See Document.Id.

startDate: Instant

The start date of the sports event.

sport: String

The sport of the sports event.

homeTeam: SportsTeam

The home team of the sports event.

awayTeam: SportsTeam

The away team of the sports event.

Public functions

build

fun build(): SportsEvent

Builds a Thing object.

setAwayTeamAccessoryScore

Added in 1.2.0-alpha02
fun setAwayTeamAccessoryScore(awayTeamAccessoryScore: String?): T

Sets the away team accessory score of the sports event. Format should be an additional contextual score that is used in some sports, e.g., like penalties in Soccer, overs in Cricket, etc.

setAwayTeamScore

Added in 1.2.0-alpha02
fun setAwayTeamScore(awayTeamScore: String?): T

Sets the away team score of the sports event. Format should be a score of the away team, e.g., "100" for Basketball, "3" for American Baseball, etc.

setAwayTeamWinProbability

Added in 1.2.0-alpha02
fun setAwayTeamWinProbability(awayTeamWinProbability: Double): T

Sets the away team win probability of the sports event. Must be a range from 0 to 1.

setGameTemporalState

Added in 1.2.0-alpha02
fun setGameTemporalState(gameTemporalState: String?): T

Sets the game temporal state of the sports event. Format should be a temporal state of the game, e.g. "Quarter 1 - 10:00" for Basketball, "Halftime" for Soccer, "9th inning" for American Baseball, etc.

setHomeTeamAccessoryScore

Added in 1.2.0-alpha02
fun setHomeTeamAccessoryScore(homeTeamAccessoryScore: String?): T

Sets the home team accessory score of the sports event. Format should be an additional contextual score that is used in some sports, e.g., like penalties in Soccer, overs in Cricket, etc.

setHomeTeamScore

Added in 1.2.0-alpha02
fun setHomeTeamScore(homeTeamScore: String?): T

Sets the home team score of the sports event. Format should be a score of the home team, e.g., "100" for basketball, "3" for American Baseball, etc.

setHomeTeamWinProbability

Added in 1.2.0-alpha02
fun setHomeTeamWinProbability(homeTeamWinProbability: Double): T

Sets the home team win probability of the sports event. Must be a range from 0 to 1.

setNotableDetail

Added in 1.2.0-alpha02
fun setNotableDetail(notableDetail: String?): T

Sets the most recent notable detail of the sports event. Format should be a most recent notable detail of the sports event, e.g. "2 outs, 2 balls, 1 strike" in American Baseball.

setOrganizer

Added in 1.2.0-alpha02
fun setOrganizer(organizer: Organization?): T

Sets the Organization of the sports event.

setPlaceHomeTeamAtStart

Added in 1.2.0-alpha02
fun setPlaceHomeTeamAtStart(placeHomeTeamAtStart: Boolean): T

Sets whether the home team should be placed at the start for a visual representation of the sports event.

setResult

Added in 1.2.0-alpha02
fun setResult(result: Long): T

Sets whether the home team won the sports event. During the course of the game, the value of this field should not be considered. The value of this field should only be set after the sports event has ended @{link SportsEventStatus.STATUS_COMPLETE} or has been cancelled @{link SportsEventStatus.STATUS_CANCELLED}, or any other terminal state.

setSportsEventStatus

Added in 1.2.0-alpha02
fun setSportsEventStatus(sportsEventStatus: Long): T

Sets the status of the sports event.

Parameters
sportsEventStatus: Long

the SportsEventStatus of the sports event.

setSportsEventStatusLabel

Added in 1.2.0-alpha02
fun setSportsEventStatusLabel(sportsEventStatusLabel: String?): T

Sets the status label of the sports event.

Parameters
sportsEventStatusLabel: String?

the status label of the sports event.