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

*** ** * ** ***


```
@ExperimentalAppSearchApi
class Event.BuilderBase<T : Event.BuilderBase<T!>?> : Thing.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)\<T!\> ||
|   | ↳ | [androidx.appsearch.builtintypes.Event.BuilderBase](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event.BuilderBase) |

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

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

Known indirect 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` |   |

*** ** * ** ***

Builder for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event.BuilderBase#BuilderBase(androidx.appsearch.builtintypes.Event)(event: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event)` Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event.BuilderBase` with all the existing values. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event.BuilderBase#BuilderBase(java.lang.String,java.lang.String,java.time.Instant)(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)` Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event.BuilderBase`. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event.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/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. |

### Inherited functions

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.
`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(event: Event)
```

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

| Parameters |
|---|---|
| `event: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event` | The existing `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event` 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)
```

Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Event.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` | The unique identifier for the Document. |
| `startDate: https://developer.android.com/reference/java/time/Instant.html` | The start date of the event. |

## Public functions

### build

```
fun build(): Event
```

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

### setDuration

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

```
fun setDuration(duration: Duration?): T
```

Sets the duration of the event as a `https://developer.android.com/reference/java/time/Duration.html`.

| Parameters |
|---|---|
| `duration: https://developer.android.com/reference/java/time/Duration.html?` | The duration of the event. |

### setEndDate

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

```
fun setEndDate(endDate: Instant?): T
```

Sets the end date of the event as a `https://developer.android.com/reference/java/time/Instant.html`.

| Parameters |
|---|---|
| `endDate: https://developer.android.com/reference/java/time/Instant.html?` | The end date of the event. |

### setLocation

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

```
fun setLocation(location: String?): T
```

Sets the location of the event. A freeform string describing the Event location. This could be a venue name, a string representation of a street address, or a string representation of a latitude/longitude pair. For example, "Some Place" or "123 Main Street, Anytown, CA" or "37.7749,-122.4194".

### setLogo

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

```
fun setLogo(logo: ImageObject?): T
```

Sets the logo of the event.