# SportsEvent.Builder

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

*** ** * ** ***


```
@Document.BuilderProducer
public final class SportsEvent.Builder extends SportsEvent.BuilderBase<SportsEvent.Builder>
```

<br />

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

*** ** * ** ***

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.Builder#Builder(androidx.appsearch.builtintypes.SportsEvent)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent sportsEvent)` Constructor with all the existing values. |
| `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.Builder#Builder(java.lang.String,java.lang.String,java.time.Instant,java.lang.String,androidx.appsearch.builtintypes.SportsTeam,androidx.appsearch.builtintypes.SportsTeam)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html namespace, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html id, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/time/Instant.html startDate, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html sport, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsTeam homeTeam, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsTeam awayTeam )` Constructor for `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.Builder`. |

### Inherited methods

From [androidx.appsearch.builtintypes.Event.BuilderBase](https://developer.android.com/reference/androidx/appsearch/builtintypes/Event.BuilderBase) `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/Event` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Event.BuilderBase#build()()`

Builds a `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing` object.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Event.BuilderBase#setDuration(java.time.Duration)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/time/Duration.html duration)`

Sets the duration of the event as a `https://developer.android.com/reference/java/time/Duration.html`.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Event.BuilderBase#setEndDate(java.time.Instant)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/time/Instant.html endDate)`

Sets the end date of the event as a `https://developer.android.com/reference/java/time/Instant.html`.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Event.BuilderBase#setLocation(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html location)`

Sets the location of the event.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Event.BuilderBase#setLogo(androidx.appsearch.builtintypes.ImageObject)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/appsearch/builtintypes/ImageObject logo)`

Sets the logo of the event.
From [androidx.appsearch.builtintypes.SportsEvent.BuilderBase](https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase) `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent` `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#build()()`

Builds a `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing` object.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setAwayTeamAccessoryScore(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html awayTeamAccessoryScore)`

Sets the away team accessory score of the sports event.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setAwayTeamScore(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html awayTeamScore)`

Sets the away team score of the sports event.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setAwayTeamWinProbability(double)(double awayTeamWinProbability)`

Sets the away team win probability of the sports event.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setGameTemporalState(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html gameTemporalState)`

Sets the game temporal state of the sports event.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setHomeTeamAccessoryScore(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html homeTeamAccessoryScore)`

Sets the home team accessory score of the sports event.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setHomeTeamScore(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html homeTeamScore)`

Sets the home team score of the sports event.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setHomeTeamWinProbability(double)(double homeTeamWinProbability)`

Sets the home team win probability of the sports event.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setNotableDetail(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html notableDetail)`

Sets the most recent notable detail of the sports event.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setOrganizer(androidx.appsearch.builtintypes.Organization)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/appsearch/builtintypes/Organization organizer)`

Sets the `https://developer.android.com/reference/androidx/appsearch/builtintypes/Organization` of the sports event.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setPlaceHomeTeamAtStart(boolean)(boolean placeHomeTeamAtStart)`

Sets whether the home team should be placed at the start for a visual representation of the sports event.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setResult(long)(long result)`

Sets whether the home team won the sports event.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setSportsEventStatus(long)(long sportsEventStatus)`

Sets the status of the sports event.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsEvent.BuilderBase#setSportsEventStatusLabel(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html sportsEventStatusLabel)`

Sets the status label of the sports event.
From [androidx.appsearch.builtintypes.Thing.BuilderBase](https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase) `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#addAlternateName(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html alternateName)`

Adds an alias for the item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#addPotentialAction(androidx.appsearch.builtintypes.PotentialAction)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction newPotentialAction)`

Add a new action to the list of potential actions for this document.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#build()()`

Builds a `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing` object.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#clearAlternateNames()()`

Clears the aliases, if any, for the item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#clearPotentialActions()()`

Clear all the potential actions for this document.
`void` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#resetIfBuilt()()`

If built, make a copy of previous data for every field so that the builder can be reused.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setAlternateNames(java.util.List<java.lang.String>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html> alternateNames)`

Sets a list of aliases for the item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setCreationTimestampMillis(long)(long creationTimestampMillis)`

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.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setDescription(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html description)`

Sets the description for the item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setDocumentScore(int)(int documentScore)`

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

Sets the time-to-live (TTL) for the current AppSearch document as a duration in milliseconds.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setImage(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html image)`

Sets the URL for an image of the item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setName(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html name)`

Sets the name of the item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setPotentialActions(java.util.List<androidx.appsearch.builtintypes.PotentialAction>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction> newPotentialActions)`

Sets a list of potential actions for this document.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setUrl(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html url)`

Sets the deeplink URL of the item.

## Public constructors

### Builder

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

```
public Builder(@NonNull SportsEvent sportsEvent)
```

Constructor with all the existing values.

### Builder

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

```
public Builder(
    @NonNull String namespace,
    @NonNull String id,
    @NonNull Instant startDate,
    @NonNull String sport,
    @NonNull SportsTeam homeTeam,
    @NonNull SportsTeam awayTeam
)
```

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html namespace` | Namespace for the Document. See `https://developer.android.com/reference/androidx/appsearch/annotation/Document.Namespace`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html id` | Unique identifier for the Document. See `https://developer.android.com/reference/androidx/appsearch/annotation/Document.Id`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/time/Instant.html startDate` | The start date of the sports event. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html sport` | The sport of the sports event. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsTeam homeTeam` | The home team of the sports event. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/SportsTeam awayTeam` | The away team of the sports event. |