@ExperimentalAppSearchApi
public class Event.BuilderBase<T extends Event.BuilderBase<T>> extends Thing.BuilderBase

Known indirect subclasses

Builder for Event.

Summary

Public constructors

Constructor for Event.BuilderBase with all the existing values.

BuilderBase(
    @NonNull String namespace,
    @NonNull String id,
    @NonNull Instant startDate
)

Constructor for Event.BuilderBase.

Public methods

@NonNull Event

Builds a Thing object.

@NonNull T

Sets the duration of the event as a Duration.

@NonNull T

Sets the end date of the event as a Instant.

@NonNull T

Sets the location of the event.

@NonNull T

Sets the logo of the event.

Inherited methods

From androidx.appsearch.builtintypes.Thing.BuilderBase
@NonNull T

Adds an alias for the item.

@NonNull T

Add a new action to the list of potential actions for this document.

@NonNull T

Clears the aliases, if any, for the item.

@NonNull T

Clear all the potential actions for this document.

void

If built, make a copy of previous data for every field so that the builder can be reused.

@NonNull T

Sets a list of aliases for the item.

@NonNull T
setCreationTimestampMillis(long creationTimestampMillis)

Sets the creation timestamp for the current AppSearch entity, in milliseconds using the currentTimeMillis time base.

@NonNull T

Sets the description for the item.

@NonNull T
setDocumentScore(int documentScore)

Sets the user-provided opaque document score of the current AppSearch document, which can be used for ranking using RANKING_STRATEGY_DOCUMENT_SCORE.

@NonNull T
setDocumentTtlMillis(long documentTtlMillis)

Sets the time-to-live (TTL) for the current AppSearch document as a duration in milliseconds.

@NonNull T

Sets the URL for an image of the item.

@NonNull T

Sets the name of the item.

@NonNull T

Sets a list of potential actions for this document.

@NonNull T

Sets the deeplink URL of the item.

Public constructors

BuilderBase

Added in 1.2.0-alpha02
public BuilderBase(@NonNull Event event)

Constructor for Event.BuilderBase with all the existing values.

Parameters
@NonNull Event event

The existing Event to copy values from.

BuilderBase

Added in 1.2.0-alpha02
public BuilderBase(
    @NonNull String namespace,
    @NonNull String id,
    @NonNull Instant startDate
)

Constructor for Event.BuilderBase.

Parameters
@NonNull String namespace

Namespace for the Document. See Document.Namespace.

@NonNull String id

The unique identifier for the Document.

@NonNull Instant startDate

The start date of the event.

Public methods

build

public @NonNull Event build()

Builds a Thing object.

setDuration

Added in 1.2.0-alpha02
public @NonNullsetDuration(@Nullable Duration duration)

Sets the duration of the event as a Duration.

Parameters
@Nullable Duration duration

The duration of the event.

setEndDate

Added in 1.2.0-alpha02
public @NonNullsetEndDate(@Nullable Instant endDate)

Sets the end date of the event as a Instant.

Parameters
@Nullable Instant endDate

The end date of the event.

setLocation

Added in 1.2.0-alpha02
public @NonNullsetLocation(@Nullable String location)

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
public @NonNullsetLogo(@Nullable ImageObject logo)

Sets the logo of the event.