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


AppSearch document representing a SportsEvent entity.

Summary

Constants

const Int

The away team won the sports event.

const Int

The sports event resolved in a draw.

const Int

The home team won the sports event.

const Int

The sports event result is unspecified.

const Int

The sports event is cancelled.

const Int

The sports event is complete.

const Int

The sports event is delayed.

const Int

The sports event is interrupted.

const Int

The sports event is live.

const Int

The sports event is postponed.

const Int

The status is unspecified.

const Int

The sports event is upcoming.

Public functions

SportsTeam

Returns the away team of the sports event.

String?

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

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.

String?

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

SportsTeam

Returns the home team of the sports event.

String?

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

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.

String?

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

Organization?

Returns the Organization of the sports event, if set.

Long

Returns the SportsEventResult for the sports event.

String

Returns the sport of the sports event.

Long

Returns the SportsEventStatus of the sports event.

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 functions

From androidx.appsearch.builtintypes.Event
Duration?

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

Instant?

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

String?

Returns the location of the event, if set.

ImageObject?

Returns the logo of the event, if set.

Instant

Returns the start date of the event as a Instant.

From androidx.appsearch.builtintypes.Thing
(Mutable)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.

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.

String

Returns the unique identifier for this item.

String?

Returns the URL for an image of this item.

String?

Returns the name of this item.

String

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

(Mutable)List<PotentialAction!>

Returns the actions that can be taken on this object.

String?

Returns the deeplink URL of this item.

Constants

RESULT_AWAY_TEAM_WON

Added in 1.2.0-alpha01
const val RESULT_AWAY_TEAM_WON = 2: Int

The away team won the sports event.

RESULT_DRAW

Added in 1.2.0-alpha01
const val RESULT_DRAW = 3: Int

The sports event resolved in a draw.

RESULT_HOME_TEAM_WON

Added in 1.2.0-alpha01
const val RESULT_HOME_TEAM_WON = 1: Int

The home team won the sports event.

RESULT_UNSPECIFIED

Added in 1.2.0-alpha01
const val RESULT_UNSPECIFIED = 0: Int

The sports event result is unspecified.

STATUS_CANCELLED

Added in 1.2.0-alpha01
const val STATUS_CANCELLED = 7: Int

The sports event is cancelled.

STATUS_COMPLETE

Added in 1.2.0-alpha01
const val STATUS_COMPLETE = 3: Int

The sports event is complete.

STATUS_DELAYED

Added in 1.2.0-alpha01
const val STATUS_DELAYED = 4: Int

The sports event is delayed.

STATUS_INTERRUPTED

Added in 1.2.0-alpha01
const val STATUS_INTERRUPTED = 5: Int

The sports event is interrupted.

STATUS_LIVE

Added in 1.2.0-alpha01
const val STATUS_LIVE = 2: Int

The sports event is live.

STATUS_POSTPONED

Added in 1.2.0-alpha01
const val STATUS_POSTPONED = 6: Int

The sports event is postponed.

STATUS_UNSPECIFIED

Added in 1.2.0-alpha01
const val STATUS_UNSPECIFIED = 0: Int

The status is unspecified.

STATUS_UPCOMING

Added in 1.2.0-alpha01
const val STATUS_UPCOMING = 1: Int

The sports event is upcoming.

Public functions

getAwayTeam

Added in 1.2.0-alpha01
fun getAwayTeam(): SportsTeam

Returns the away team of the sports event.

getAwayTeamAccessoryScore

Added in 1.2.0-alpha01
fun getAwayTeamAccessoryScore(): String?

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
fun getAwayTeamScore(): 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.

getAwayTeamWinProbability

Added in 1.2.0-alpha01
fun getAwayTeamWinProbability(): Double

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
fun getGameTemporalState(): String?

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
fun getHomeTeam(): SportsTeam

Returns the home team of the sports event.

getHomeTeamAccessoryScore

Added in 1.2.0-alpha01
fun getHomeTeamAccessoryScore(): String?

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
fun getHomeTeamScore(): 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.

getHomeTeamWinProbability

Added in 1.2.0-alpha01
fun getHomeTeamWinProbability(): Double

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
fun getNotableDetail(): String?

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
fun getOrganizer(): Organization?

Returns the Organization of the sports event, if set.

getResult

Added in 1.2.0-alpha01
fun getResult(): Long

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
fun getSport(): String

Returns the sport of the sports event.

getSportsEventStatus

Added in 1.2.0-alpha01
fun getSportsEventStatus(): Long

Returns the SportsEventStatus of the sports event.

getSportsEventStatusLabel

Added in 1.2.0-alpha01
fun getSportsEventStatusLabel(): String?

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

isPlaceHomeTeamAtStart

Added in 1.2.0-alpha01
fun isPlaceHomeTeamAtStart(): Boolean

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