@RequiresApi(api = Build.VERSION_CODES.O)
@Document(name = "builtin:SportsEvent")
public class SportsEvent extends Event


AppSearch document representing a SportsEvent entity.

Summary

Nested types

Constants

static final int

The away team won the sports event.

static final int

The sports event resolved in a draw.

static final int

The home team won the sports event.

static final int

The sports event result is unspecified.

static final int

The sports event is cancelled.

static final int

The sports event is complete.

static final int

The sports event is delayed.

static final int

The sports event is interrupted.

static final int

The sports event is live.

static final int

The sports event is postponed.

static final int

The status is unspecified.

static final int

The sports event is upcoming.

Public methods

@NonNull SportsTeam

Returns the away team of the sports event.

@Nullable String

Returns the away team accessory score of the sports event, if set.

@Nullable String

Returns the home team score of the sports event, if set. e.g., "100" for Basketball, "3" for American Baseball, "Love" or "Deuce" for Tennis, etc.

double

Returns the away team win probability of the sports event, if set.

@Nullable String

Returns the game temporal state of the sports event, if set.

@NonNull SportsTeam

Returns the home team of the sports event.

@Nullable String

Returns the home team accessory score of the sports event, if set.

@Nullable String

Returns the home team score of the sports event, if set. e.g., "100" for Basketball, "3" for American Baseball, "Love" or "Deuce" for Tennis, etc.

double

Returns the home team win probability of the sports event.

@Nullable String

Returns the most recent notable detail of the sports event, if set.

@Nullable Organization

Returns the Organization of the sports event, if set.

long

Returns the SportsEventResult for the sports event.

@NonNull String

Returns the sport of the sports event.

long

Returns the SportsEventStatus of the sports event.

@Nullable String

Returns the status label of the sports event.

boolean

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

Inherited methods

From androidx.appsearch.builtintypes.Event
@Nullable Duration

Returns the duration of the event as a Duration, if set.

@Nullable Instant

Returns the end date of the event as a Instant, if set.

@Nullable String

Returns the location of the event, if set.

@Nullable ImageObject

Returns the logo of the event, if set.

@NonNull Instant

Returns the start date of the event as a Instant.

From androidx.appsearch.builtintypes.Thing
@NonNull List<String>

Returns an unmodifiable list of aliases, if any, for this item.

long

Returns the creation timestamp, in milliseconds since Unix epoch, of this item.

@Nullable String

Returns a description of this item.

int

Returns the intrinsic score (or importance) of this item.

long

Returns the time-to-live timestamp, in milliseconds since getCreationTimestampMillis, for this item.

@NonNull String

Returns the unique identifier for this item.

@Nullable String

Returns the URL for an image of this item.

@Nullable String

Returns the name of this item.

@NonNull String

Returns the namespace (or logical grouping) for this item.

@NonNull List<PotentialAction>

Returns the actions that can be taken on this object.

@Nullable String

Returns the deeplink URL of this item.

Constants

RESULT_AWAY_TEAM_WON

Added in 1.2.0-alpha01
public static final int RESULT_AWAY_TEAM_WON = 2

The away team won the sports event.

RESULT_DRAW

Added in 1.2.0-alpha01
public static final int RESULT_DRAW = 3

The sports event resolved in a draw.

RESULT_HOME_TEAM_WON

Added in 1.2.0-alpha01
public static final int RESULT_HOME_TEAM_WON = 1

The home team won the sports event.

RESULT_UNSPECIFIED

Added in 1.2.0-alpha01
public static final int RESULT_UNSPECIFIED = 0

The sports event result is unspecified.

STATUS_CANCELLED

Added in 1.2.0-alpha01
public static final int STATUS_CANCELLED = 7

The sports event is cancelled.

STATUS_COMPLETE

Added in 1.2.0-alpha01
public static final int STATUS_COMPLETE = 3

The sports event is complete.

STATUS_DELAYED

Added in 1.2.0-alpha01
public static final int STATUS_DELAYED = 4

The sports event is delayed.

STATUS_INTERRUPTED

Added in 1.2.0-alpha01
public static final int STATUS_INTERRUPTED = 5

The sports event is interrupted.

STATUS_LIVE

Added in 1.2.0-alpha01
public static final int STATUS_LIVE = 2

The sports event is live.

STATUS_POSTPONED

Added in 1.2.0-alpha01
public static final int STATUS_POSTPONED = 6

The sports event is postponed.

STATUS_UNSPECIFIED

Added in 1.2.0-alpha01
public static final int STATUS_UNSPECIFIED = 0

The status is unspecified.

STATUS_UPCOMING

Added in 1.2.0-alpha01
public static final int STATUS_UPCOMING = 1

The sports event is upcoming.

Public methods

getAwayTeam

Added in 1.2.0-alpha01
public @NonNull SportsTeam getAwayTeam()

Returns the away team of the sports event.

getAwayTeamAccessoryScore

Added in 1.2.0-alpha01
public @Nullable String getAwayTeamAccessoryScore()

Returns the away team accessory score of the sports event, if set. The accessory score is an additional contextual score that is used in some sports, e.g., like penalties in Soccer, overs in Cricket, etc.

getAwayTeamScore

Added in 1.2.0-alpha01
public @Nullable String getAwayTeamScore()

Returns the home team score of the sports event, if set. e.g., "100" for Basketball, "3" for American Baseball, "Love" or "Deuce" for Tennis, etc.

getAwayTeamWinProbability

Added in 1.2.0-alpha01
public double getAwayTeamWinProbability()

Returns the away team win probability of the sports event, if set. The win probability is a range from 0 to 1.

getGameTemporalState

Added in 1.2.0-alpha01
public @Nullable String getGameTemporalState()

Returns the game temporal state of the sports event, if set. Temporal state of the game, e.g. "Quarter 1 - 10:00" for Basketball, "Halftime" for Soccer, "9th inning" for American Baseball, etc.

getHomeTeam

Added in 1.2.0-alpha01
public @NonNull SportsTeam getHomeTeam()

Returns the home team of the sports event.

getHomeTeamAccessoryScore

Added in 1.2.0-alpha01
public @Nullable String getHomeTeamAccessoryScore()

Returns the home team accessory score of the sports event, if set. The accessory score is an additional contextual score that is used in some sports, e.g., like penalties in Soccer, overs in Cricket, etc.

getHomeTeamScore

Added in 1.2.0-alpha01
public @Nullable String getHomeTeamScore()

Returns the home team score of the sports event, if set. e.g., "100" for Basketball, "3" for American Baseball, "Love" or "Deuce" for Tennis, etc.

getHomeTeamWinProbability

Added in 1.2.0-alpha01
public double getHomeTeamWinProbability()

Returns the home team win probability of the sports event. The win probability is a range from 0 to 1.

getNotableDetail

Added in 1.2.0-alpha01
public @Nullable String getNotableDetail()

Returns the most recent notable detail of the sports event, if set. For example, "2 outs, 2 balls, 1 strike" in baseball.

getOrganizer

Added in 1.2.0-alpha01
public @Nullable Organization getOrganizer()

Returns the Organization of the sports event, if set.

getResult

Added in 1.2.0-alpha01
public long getResult()

Returns the SportsEventResult for 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.

getSport

Added in 1.2.0-alpha01
public @NonNull String getSport()

Returns the sport of the sports event.

getSportsEventStatus

Added in 1.2.0-alpha01
public long getSportsEventStatus()

Returns the SportsEventStatus of the sports event.

getSportsEventStatusLabel

Added in 1.2.0-alpha01
public @Nullable String getSportsEventStatusLabel()

Returns the status label of the sports event. Which is a localized string representation of the SportsEventStatus.

isPlaceHomeTeamAtStart

Added in 1.2.0-alpha01
public boolean isPlaceHomeTeamAtStart()

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