# SportsEvent.BuilderBase

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

*** ** * ** ***


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

<br />

|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) ||||
| ↳ | [androidx.appsearch.builtintypes.Thing.BuilderBase](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase) |||
|   | ↳ | [androidx.appsearch.builtintypes.Event.BuilderBase](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event.BuilderBase)\<T!\> ||
|   |   | ↳ | [androidx.appsearch.builtintypes.SportsEvent.BuilderBase](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase) |

Known direct subclasses [SportsEvent.Builder](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.Builder)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.Builder` |   |

*** ** * ** ***

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#BuilderBase(androidx.appsearch.builtintypes.SportsEvent)(sportsEvent: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent)` Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase` with all the existing values. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#BuilderBase(java.lang.String,java.lang.String,java.time.Instant,java.lang.String,androidx.appsearch.builtintypes.SportsTeam,androidx.appsearch.builtintypes.SportsTeam)( namespace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, startDate: https://developer.android.com/reference/java/time/Instant.html, sport: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, homeTeam: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsTeam, awayTeam: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsTeam )` Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase`. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#build()()` Builds a `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing` object. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setAwayTeamAccessoryScore(java.lang.String)(awayTeamAccessoryScore: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Sets the away team accessory score of the sports event. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setAwayTeamScore(java.lang.String)(awayTeamScore: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Sets the away team score of the sports event. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setAwayTeamWinProbability(double)(awayTeamWinProbability: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)` Sets the away team win probability of the sports event. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setGameTemporalState(java.lang.String)(gameTemporalState: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Sets the game temporal state of the sports event. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setHomeTeamAccessoryScore(java.lang.String)(homeTeamAccessoryScore: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Sets the home team accessory score of the sports event. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setHomeTeamScore(java.lang.String)(homeTeamScore: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Sets the home team score of the sports event. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setHomeTeamWinProbability(double)(homeTeamWinProbability: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)` Sets the home team win probability of the sports event. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setNotableDetail(java.lang.String)(notableDetail: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Sets the most recent notable detail of the sports event. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setOrganizer(androidx.appsearch.builtintypes.Organization)(organizer: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Organization?)` Sets the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Organization` of the sports event. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setPlaceHomeTeamAtStart(boolean)(placeHomeTeamAtStart: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether the home team should be placed at the start for a visual representation of the sports event. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setResult(long)(result: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets whether the home team won the sports event. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setSportsEventStatus(long)(sportsEventStatus: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the status of the sports event. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setSportsEventStatusLabel(java.lang.String)(sportsEventStatusLabel: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Sets the status label of the sports event. |

### Inherited functions

From [androidx.appsearch.builtintypes.Event.BuilderBase](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event.BuilderBase) `T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event.BuilderBase#setDuration(java.time.Duration)(duration: https://developer.android.com/reference/java/time/Duration.html?)`

Sets the duration of the event as a `https://developer.android.com/reference/java/time/Duration.html`.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event.BuilderBase#setEndDate(java.time.Instant)(endDate: https://developer.android.com/reference/java/time/Instant.html?)`

Sets the end date of the event as a `https://developer.android.com/reference/java/time/Instant.html`.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event.BuilderBase#setLocation(java.lang.String)(location: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)`

Sets the location of the event.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event.BuilderBase#setLogo(androidx.appsearch.builtintypes.ImageObject)(logo: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/ImageObject?)`

Sets the logo of the event.
From [androidx.appsearch.builtintypes.Thing.BuilderBase](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase) `T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#addAlternateName(java.lang.String)(alternateName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`

Adds an alias for the item.
`T` `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#addPotentialAction(androidx.appsearch.builtintypes.PotentialAction)(newPotentialAction: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/PotentialAction)`

Add a new action to the list of potential actions for this document.
`https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#build()()`

Builds a `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing` object.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#clearAlternateNames()()`

Clears the aliases, if any, for the item.
`T` `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#clearPotentialActions()()`

Clear all the potential actions for this document.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#resetIfBuilt()()`

If built, make a copy of previous data for every field so that the builder can be reused.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setAlternateNames(java.util.List<java.lang.String>)(alternateNames: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>?)`

Sets a list of aliases for the item.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setCreationTimestampMillis(long)(creationTimestampMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`

Sets the creation timestamp for the current AppSearch entity, in milliseconds using the `https://developer.android.com/reference/java/lang/System.html#currentTimeMillis()` time base.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setDescription(java.lang.String)(description: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)`

Sets the description for the item.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setDocumentScore(int)(documentScore: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Sets the user-provided opaque document score of the current AppSearch document, which can be used for ranking using `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSpec#RANKING_STRATEGY_DOCUMENT_SCORE()`.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setDocumentTtlMillis(long)(documentTtlMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`

Sets the time-to-live (TTL) for the current AppSearch document as a duration in milliseconds.
`T` `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setImage(java.lang.String)(image: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)`

Sets the URL for an image of the item.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setName(java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)`

Sets the name of the item.
`T` `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setPotentialActions(java.util.List<androidx.appsearch.builtintypes.PotentialAction>)(
newPotentialActions: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/PotentialAction!>?
)`

Sets a list of potential actions for this document.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setUrl(java.lang.String)(url: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)`

Sets the deeplink URL of the item.

## Public constructors

### BuilderBase

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

```
BuilderBase(sportsEvent: SportsEvent)
```

Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.BuilderBase` with all the existing values.

| Parameters |
|---|---|
| `sportsEvent: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent` | The existing `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent` to copy values from. |

### BuilderBase

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

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

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

| Parameters |
|---|---|
| `namespace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Namespace for the Document. See `https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document.Namespace`. |
| `id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Unique identifier for the Document. See `https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document.Id`. |
| `startDate: https://developer.android.com/reference/java/time/Instant.html` | The start date of the sports event. |
| `sport: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The sport of the sports event. |
| `homeTeam: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsTeam` | The home team of the sports event. |
| `awayTeam: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsTeam` | The away team of the sports event. |

## Public functions

### build

```
fun build(): SportsEvent
```

Builds a `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing` object.

### setAwayTeamAccessoryScore

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

```
fun setOrganizer(organizer: Organization?): T
```

Sets the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Organization` of the sports event.

### setPlaceHomeTeamAtStart

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

```
fun setSportsEventStatus(sportsEventStatus: Long): T
```

Sets the status of the sports event.

| Parameters |
|---|---|
| `sportsEventStatus: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/SportsEvent.SportsEventStatus` of the sports event. |

### setSportsEventStatusLabel

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

```
fun setSportsEventStatusLabel(sportsEventStatusLabel: String?): T
```

Sets the status label of the sports event.

| Parameters |
|---|---|
| `sportsEventStatusLabel: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | the status label of the sports event. |