# SportsEvent

Artifact: [androidx.appsearch:appsearch-builtin-types](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/builtintypes/SportsEvent.java+class:androidx.appsearch.builtintypes.SportsEvent) Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

*** ** * ** ***


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

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [androidx.appsearch.builtintypes.Thing](https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing) |||
|   | ↳ | [androidx.appsearch.builtintypes.Event](https://developer.android.com/reference/androidx/appsearch/builtintypes/Event) ||
|   |   | ↳ | [androidx.appsearch.builtintypes.SportsEvent](https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent) |

*** ** * ** ***

AppSearch document representing a `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent` entity.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/androidx/appsearch/annotation/Document.BuilderProducer public final class https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.Builder extends https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase<https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.Builder>` |
| `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi public class https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase<T extends https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase<T>> extends https://developer.android.com/reference/androidx/appsearch/builtintypes/Event.BuilderBase<T>` |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#RESULT_AWAY_TEAM_WON() = 2` The away team won the sports event. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#RESULT_DRAW() = 3` The sports event resolved in a draw. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#RESULT_HOME_TEAM_WON() = 1` The home team won the sports event. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#RESULT_UNSPECIFIED() = 0` The sports event result is unspecified. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#STATUS_CANCELLED() = 7` The sports event is cancelled. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#STATUS_COMPLETE() = 3` The sports event is complete. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#STATUS_DELAYED() = 4` The sports event is delayed. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#STATUS_INTERRUPTED() = 5` The sports event is interrupted. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#STATUS_LIVE() = 2` The sports event is live. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#STATUS_POSTPONED() = 6` The sports event is postponed. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#STATUS_UNSPECIFIED() = 0` The status is unspecified. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#STATUS_UPCOMING() = 1` The sports event is upcoming. |

| ### Public constructors |
|---|
| `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#SportsEvent(androidx.appsearch.builtintypes.SportsEvent.BuilderBase<?>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase<@https://developer.android.com/reference/androidx/annotation/NonNull ?> builder)` Constructor for `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsTeam` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#getAwayTeam()()` Returns the away team of the sports event. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#getAwayTeamAccessoryScore()()` Returns the away team accessory score of the sports event, if set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#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. |
| `double` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#getAwayTeamWinProbability()()` Returns the away team win probability of the sports event, if set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#getGameTemporalState()()` Returns the game temporal state of the sports event, if set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsTeam` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#getHomeTeam()()` Returns the home team of the sports event. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#getHomeTeamAccessoryScore()()` Returns the home team accessory score of the sports event, if set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#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. |
| `double` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#getHomeTeamWinProbability()()` Returns the home team win probability of the sports event. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#getNotableDetail()()` Returns the most recent notable detail of the sports event, if set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/appsearch/builtintypes/Organization` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#getOrganizer()()` Returns the `https://developer.android.com/reference/androidx/appsearch/builtintypes/Organization` of the sports event, if set. |
| `long` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#getResult()()` Returns the `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.SportsEventResult` for the sports event. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#getSport()()` Returns the sport of the sports event. |
| `long` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#getSportsEventStatus()()` Returns the `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.SportsEventStatus` of the sports event. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#getSportsEventStatusLabel()()` Returns the status label of the sports event. |
| `boolean` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent#isPlaceHomeTeamAtStart()()` 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](https://developer.android.com/reference/androidx/appsearch/builtintypes/Event) `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/time/Duration.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Event#getDuration()()`

Returns the duration of the event as a `https://developer.android.com/reference/java/time/Duration.html`, if set.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/time/Instant.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Event#getEndDate()()`

Returns the end date of the event as a `https://developer.android.com/reference/java/time/Instant.html`, if set.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Event#getLocation()()`

Returns the location of the event, if set.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/appsearch/builtintypes/ImageObject` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Event#getLogo()()`

Returns the logo of the event, if set.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/time/Instant.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Event#getStartDate()()`

Returns the start date of the event as a `https://developer.android.com/reference/java/time/Instant.html`.
From [androidx.appsearch.builtintypes.Thing](https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing) `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html>` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getAlternateNames()()`

Returns an unmodifiable list of aliases, if any, for this item.
`long` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getCreationTimestampMillis()()`

Returns the creation timestamp, in milliseconds since Unix epoch, of this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getDescription()()`

Returns a description of this item.
`int` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getDocumentScore()()`

Returns the intrinsic score (or importance) of this item.
`long` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getDocumentTtlMillis()()`

Returns the time-to-live timestamp, in milliseconds since `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getCreationTimestampMillis()`, for this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getId()()`

Returns the unique identifier for this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getImage()()`

Returns the URL for an image of this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getName()()`

Returns the name of this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getNamespace()()`

Returns the namespace (or logical grouping) for this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction>` `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getPotentialActions()()`

Returns the actions that can be taken on this object.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getUrl()()`

Returns the deeplink URL of this item.

## Constants

### RESULT_AWAY_TEAM_WON

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public static final int RESULT_AWAY_TEAM_WON = 2
```

The away team won the sports event.

### RESULT_DRAW

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public static final int RESULT_DRAW = 3
```

The sports event resolved in a draw.

### RESULT_HOME_TEAM_WON

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public static final int RESULT_HOME_TEAM_WON = 1
```

The home team won the sports event.

### RESULT_UNSPECIFIED

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public static final int RESULT_UNSPECIFIED = 0
```

The sports event result is unspecified.

### STATUS_CANCELLED

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public static final int STATUS_CANCELLED = 7
```

The sports event is cancelled.

### STATUS_COMPLETE

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public static final int STATUS_COMPLETE = 3
```

The sports event is complete.

### STATUS_DELAYED

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public static final int STATUS_DELAYED = 4
```

The sports event is delayed.

### STATUS_INTERRUPTED

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public static final int STATUS_INTERRUPTED = 5
```

The sports event is interrupted.

### STATUS_LIVE

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public static final int STATUS_LIVE = 2
```

The sports event is live.

### STATUS_POSTPONED

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public static final int STATUS_POSTPONED = 6
```

The sports event is postponed.

### STATUS_UNSPECIFIED

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public static final int STATUS_UNSPECIFIED = 0
```

The status is unspecified.

### STATUS_UPCOMING

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public static final int STATUS_UPCOMING = 1
```

The sports event is upcoming.

## Public constructors

### SportsEvent

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
@ExperimentalAppSearchApi
public SportsEvent(@NonNull SportsEvent.BuilderBase<@NonNull ?> builder)
```

Constructor for `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase<@https://developer.android.com/reference/androidx/annotation/NonNull ?> builder` | The builder to construct the `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent` from. |

## Public methods

### getAwayTeam

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public @NonNull SportsTeam getAwayTeam()
```

Returns the away team of the sports event.

### getAwayTeamAccessoryScore

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
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-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
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-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
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-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
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-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public @NonNull SportsTeam getHomeTeam()
```

Returns the home team of the sports event.

### getHomeTeamAccessoryScore

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
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-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
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-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
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-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
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-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public @Nullable Organization getOrganizer()
```

Returns the `https://developer.android.com/reference/androidx/appsearch/builtintypes/Organization` of the sports event, if set.

### getResult

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public long getResult()
```

Returns the `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.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-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public @NonNull String getSport()
```

Returns the sport of the sports event.

### getSportsEventStatus

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public long getSportsEventStatus()
```

Returns the `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.SportsEventStatus` of the sports event.

### getSportsEventStatusLabel

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public @Nullable String getSportsEventStatusLabel()
```

Returns the status label of the sports event. Which is a localized string representation of the `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.SportsEventStatus`.

### isPlaceHomeTeamAtStart

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
public boolean isPlaceHomeTeamAtStart()
```

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