SportsEvent.BuilderBase


@ExperimentalAppSearchApi
public class SportsEvent.BuilderBase<T extends SportsEvent.BuilderBase<T>> extends Event.BuilderBase

Known direct subclasses

Summary

Public constructors

Constructor for SportsEvent.BuilderBase with all the existing values.

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

Constructor for SportsEvent.BuilderBase.

Public methods

@NonNull SportsEvent

Builds a Thing object.

@NonNull T
setAwayTeamAccessoryScore(@Nullable String awayTeamAccessoryScore)

Sets the away team accessory score of the sports event.

@NonNull T

Sets the away team score of the sports event.

@NonNull T
setAwayTeamWinProbability(double awayTeamWinProbability)

Sets the away team win probability of the sports event.

@NonNull T
setGameTemporalState(@Nullable String gameTemporalState)

Sets the game temporal state of the sports event.

@NonNull T
setHomeTeamAccessoryScore(@Nullable String homeTeamAccessoryScore)

Sets the home team accessory score of the sports event.

@NonNull T

Sets the home team score of the sports event.

@NonNull T
setHomeTeamWinProbability(double homeTeamWinProbability)

Sets the home team win probability of the sports event.

@NonNull T

Sets the most recent notable detail of the sports event.

@NonNull T

Sets the Organization of the sports event.

@NonNull T
setPlaceHomeTeamAtStart(boolean placeHomeTeamAtStart)

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

@NonNull T
setResult(long result)

Sets whether the home team won the sports event.

@NonNull T
setSportsEventStatus(long sportsEventStatus)

Sets the status of the sports event.

@NonNull T
setSportsEventStatusLabel(@Nullable String sportsEventStatusLabel)

Sets the status label of the sports event.

Inherited methods

From androidx.appsearch.builtintypes.Event.BuilderBase
@NonNull T

Sets the duration of the event as a Duration.

@NonNull T

Sets the end date of the event as a Instant.

@NonNull T

Sets the location of the event.

@NonNull T

Sets the logo of the event.

From androidx.appsearch.builtintypes.Thing.BuilderBase
@NonNull T

Adds an alias for the item.

@NonNull T

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

@NonNull Thing

Builds a Thing object.

@NonNull T

Clears the aliases, if any, for the item.

@NonNull T

Clear all the potential actions for this document.

void

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

@NonNull T

Sets a list of aliases for the item.

@NonNull T
setCreationTimestampMillis(long creationTimestampMillis)

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

@NonNull T

Sets the description for the item.

@NonNull T
setDocumentScore(int documentScore)

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

@NonNull T
setDocumentTtlMillis(long documentTtlMillis)

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

@NonNull T

Sets the URL for an image of the item.

@NonNull T

Sets the name of the item.

@NonNull T

Sets a list of potential actions for this document.

@NonNull T

Sets the deeplink URL of the item.

Public constructors

BuilderBase

Added in 1.2.0-alpha02
public BuilderBase(@NonNull SportsEvent sportsEvent)

Constructor for SportsEvent.BuilderBase with all the existing values.

Parameters
@NonNull SportsEvent sportsEvent

The existing SportsEvent to copy values from.

BuilderBase

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

Constructor for SportsEvent.BuilderBase.

Parameters
@NonNull String namespace

Namespace for the Document. See Document.Namespace.

@NonNull String id

Unique identifier for the Document. See Document.Id.

@NonNull Instant startDate

The start date of the sports event.

@NonNull String sport

The sport of the sports event.

@NonNull SportsTeam homeTeam

The home team of the sports event.

@NonNull SportsTeam awayTeam

The away team of the sports event.

Public methods

build

public @NonNull SportsEvent build()

Builds a Thing object.

setAwayTeamAccessoryScore

Added in 1.2.0-alpha02
public @NonNullsetAwayTeamAccessoryScore(@Nullable String awayTeamAccessoryScore)

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
public @NonNullsetAwayTeamScore(@Nullable String awayTeamScore)

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
public @NonNullsetAwayTeamWinProbability(double awayTeamWinProbability)

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
public @NonNullsetGameTemporalState(@Nullable String gameTemporalState)

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
public @NonNullsetHomeTeamAccessoryScore(@Nullable String homeTeamAccessoryScore)

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
public @NonNullsetHomeTeamScore(@Nullable String homeTeamScore)

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
public @NonNullsetHomeTeamWinProbability(double homeTeamWinProbability)

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
public @NonNullsetNotableDetail(@Nullable String notableDetail)

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
public @NonNullsetOrganizer(@Nullable Organization organizer)

Sets the Organization of the sports event.

setPlaceHomeTeamAtStart

Added in 1.2.0-alpha02
public @NonNullsetPlaceHomeTeamAtStart(boolean placeHomeTeamAtStart)

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
public @NonNullsetResult(long result)

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
public @NonNullsetSportsEventStatus(long sportsEventStatus)

Sets the status of the sports event.

Parameters
long sportsEventStatus

the SportsEventStatus of the sports event.

setSportsEventStatusLabel

Added in 1.2.0-alpha02
public @NonNullsetSportsEventStatusLabel(@Nullable String sportsEventStatusLabel)

Sets the status label of the sports event.

Parameters
@Nullable String sportsEventStatusLabel

the status label of the sports event.