@Document.BuilderProducer
class SportsEvent.Builder


Summary

Public constructors

Builder(sportsEvent: SportsEvent)

Constructor with all the existing values.

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

Constructor for SportsEvent.Builder.

Public functions

T
addAlternateName(alternateName: String)

Adds an alias for the item.

T

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

SportsEvent

Builds a Thing object.

Event

Builds a Thing object.

Thing

Builds a Thing object.

T

Clears the aliases, if any, for the item.

T

Clear all the potential actions for this document.

T
setAlternateNames(alternateNames: (Mutable)List<String!>?)

Sets a list of aliases for the item.

T
setAwayTeamAccessoryScore(awayTeamAccessoryScore: String?)

Sets the away team accessory score of the sports event.

T
setAwayTeamScore(awayTeamScore: String?)

Sets the away team score of the sports event.

T
setAwayTeamWinProbability(awayTeamWinProbability: Double)

Sets the away team win probability of the sports event.

T
setCreationTimestampMillis(creationTimestampMillis: Long)

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

T
setDescription(description: String?)

Sets the description for the item.

T
setDocumentScore(documentScore: Int)

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

T
setDocumentTtlMillis(documentTtlMillis: Long)

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

T
setDuration(duration: Duration?)

Sets the duration of the event as a Duration.

T
setEndDate(endDate: Instant?)

Sets the end date of the event as a Instant.

T
setGameTemporalState(gameTemporalState: String?)

Sets the game temporal state of the sports event.

T
setHomeTeamAccessoryScore(homeTeamAccessoryScore: String?)

Sets the home team accessory score of the sports event.

T
setHomeTeamScore(homeTeamScore: String?)

Sets the home team score of the sports event.

T
setHomeTeamWinProbability(homeTeamWinProbability: Double)

Sets the home team win probability of the sports event.

T

Sets the URL for an image of the item.

T
setLocation(location: String?)

Sets the location of the event.

T

Sets the logo of the event.

T
setName(name: String?)

Sets the name of the item.

T
setNotableDetail(notableDetail: String?)

Sets the most recent notable detail of the sports event.

T

Sets the Organization of the sports event.

T
setPlaceHomeTeamAtStart(placeHomeTeamAtStart: Boolean)

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

T

Sets a list of potential actions for this document.

T
setResult(result: Long)

Sets whether the home team won the sports event.

T
setSportsEventStatus(sportsEventStatus: Long)

Sets the status of the sports event.

T
setSportsEventStatusLabel(sportsEventStatusLabel: String?)

Sets the status label of the sports event.

T
setUrl(url: String?)

Sets the deeplink URL of the item.

Public constructors

Builder

Added in 1.2.0-alpha01
Builder(sportsEvent: SportsEvent)

Constructor with all the existing values.

Builder

Added in 1.2.0-alpha01
Builder(
    namespace: String,
    id: String,
    startDate: Instant,
    sport: String,
    homeTeam: SportsTeam,
    awayTeam: SportsTeam
)

Constructor for SportsEvent.Builder.

Parameters
namespace: String

Namespace for the Document. See Document.Namespace.

id: String

Unique identifier for the Document. See Document.Id.

startDate: Instant

The start date of the sports event.

sport: String

The sport of the sports event.

homeTeam: SportsTeam

The home team of the sports event.

awayTeam: SportsTeam

The away team of the sports event.

Public functions

addAlternateName

Added in 1.2.0-alpha01
fun addAlternateName(alternateName: String): T

Adds an alias for the item.

addPotentialAction

Added in 1.2.0-alpha01
@ExperimentalAppSearchApi
fun addPotentialAction(newPotentialAction: PotentialAction): T

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

build

Added in 1.2.0-alpha01
fun build(): SportsEvent

Builds a Thing object.

build

Added in 1.2.0-alpha01
fun build(): Event

Builds a Thing object.

build

Added in 1.2.0-alpha01
fun build(): Thing

Builds a Thing object.

clearAlternateNames

Added in 1.2.0-alpha01
fun clearAlternateNames(): T

Clears the aliases, if any, for the item.

clearPotentialActions

Added in 1.2.0-alpha01
@ExperimentalAppSearchApi
fun clearPotentialActions(): T

Clear all the potential actions for this document.

setAlternateNames

Added in 1.2.0-alpha01
fun setAlternateNames(alternateNames: (Mutable)List<String!>?): T

Sets a list of aliases for the item.

setAwayTeamAccessoryScore

Added in 1.2.0-alpha01
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-alpha01
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-alpha01
fun setAwayTeamWinProbability(awayTeamWinProbability: Double): T

Sets the away team win probability of the sports event. Must be a range from 0 to 1.

setCreationTimestampMillis

Added in 1.2.0-alpha01
fun setCreationTimestampMillis(creationTimestampMillis: Long): T

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

This timestamp refers to the creation time of the AppSearch entity, not when the document is written into AppSearch.

If not set, then the current timestamp will be used.

See androidx.appsearch.annotation.Document.CreationTimestampMillis for more information on creation timestamp.

setDescription

Added in 1.2.0-alpha01
fun setDescription(description: String?): T

Sets the description for the item.

setDocumentScore

Added in 1.2.0-alpha01
fun setDocumentScore(documentScore: Int): T

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

See androidx.appsearch.annotation.Document.Score for more information on score.

setDocumentTtlMillis

Added in 1.2.0-alpha01
fun setDocumentTtlMillis(documentTtlMillis: Long): T

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

The document will be automatically deleted when the TTL expires.

If not set, then the document will never expire.

See androidx.appsearch.annotation.Document.TtlMillis for more information on TTL.

setDuration

Added in 1.2.0-alpha01
fun setDuration(duration: Duration?): T

Sets the duration of the event as a Duration.

Parameters
duration: Duration?

The duration of the event.

setEndDate

Added in 1.2.0-alpha01
fun setEndDate(endDate: Instant?): T

Sets the end date of the event as a Instant.

Parameters
endDate: Instant?

The end date of the event.

setGameTemporalState

Added in 1.2.0-alpha01
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-alpha01
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-alpha01
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-alpha01
fun setHomeTeamWinProbability(homeTeamWinProbability: Double): T

Sets the home team win probability of the sports event. Must be a range from 0 to 1.

setImage

Added in 1.2.0-alpha01
@ExperimentalAppSearchApi
fun setImage(image: String?): T

Sets the URL for an image of the item.

setLocation

Added in 1.2.0-alpha01
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-alpha01
fun setLogo(logo: ImageObject?): T

Sets the logo of the event.

setName

Added in 1.2.0-alpha01
fun setName(name: String?): T

Sets the name of the item.

setNotableDetail

Added in 1.2.0-alpha01
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-alpha01
fun setOrganizer(organizer: Organization?): T

Sets the Organization of the sports event.

setPlaceHomeTeamAtStart

Added in 1.2.0-alpha01
fun setPlaceHomeTeamAtStart(placeHomeTeamAtStart: Boolean): T

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

setPotentialActions

Added in 1.2.0-alpha01
@ExperimentalAppSearchApi
fun setPotentialActions(
    newPotentialActions: (Mutable)List<PotentialAction!>?
): T

Sets a list of potential actions for this document.

setResult

Added in 1.2.0-alpha01
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-alpha01
fun setSportsEventStatus(sportsEventStatus: Long): T

Sets the status of the sports event.

Parameters
sportsEventStatus: Long

the SportsEventStatus of the sports event.

setSportsEventStatusLabel

Added in 1.2.0-alpha01
fun setSportsEventStatusLabel(sportsEventStatusLabel: String?): T

Sets the status label of the sports event.

Parameters
sportsEventStatusLabel: String?

the status label of the sports event.

setUrl

Added in 1.2.0-alpha01
fun setUrl(url: String?): T

Sets the deeplink URL of the item.

If this item can be displayed by any system UI surface, or can be read by another Android package, through one of the androidx.appsearch.app.SetSchemaRequest.Builder methods, this url should act as a deeplink into the activity that can open it. Callers should be able to construct an ACTION_VIEW intent with the url as the setData to view the item inside your application.

See Allowing Other Apps to Start Your Activity for more details on how to make activities in your app open for use by other apps by defining intent filters.

Protected properties

mAlternateNames

protected val mAlternateNames: (Mutable)List<String!>!

mAwayTeam

protected val mAwayTeamSportsTeam!

mAwayTeamAccessoryScore

protected val mAwayTeamAccessoryScoreString?

mAwayTeamScore

protected val mAwayTeamScoreString?

mAwayTeamWinProbability

protected val mAwayTeamWinProbabilityDouble

mCreationTimestampMillis

protected val mCreationTimestampMillisLong

mDescription

protected val mDescriptionString!

mDocumentScore

protected val mDocumentScoreInt

mDocumentTtlMillis

protected val mDocumentTtlMillisLong

mDuration

protected val mDurationDuration!

mEndDate

protected val mEndDateInstant!

mGameTemporalState

protected val mGameTemporalStateString?

mHomeTeam

protected val mHomeTeamSportsTeam!

mHomeTeamAccessoryScore

protected val mHomeTeamAccessoryScoreString?

mHomeTeamScore

protected val mHomeTeamScoreString?

mHomeTeamWinProbability

protected val mHomeTeamWinProbabilityDouble

mId

protected val mIdString!

mImage

protected val mImageString!

mLocation

protected val mLocationString!

mLogo

protected val mLogoImageObject!

mName

protected val mNameString!

mNamespace

protected val mNamespaceString!

mNotableDetail

protected val mNotableDetailString?

mOrganizer

protected val mOrganizerOrganization?

mPlaceHomeTeamAtStart

protected val mPlaceHomeTeamAtStartBoolean

mPotentialActions

protected val mPotentialActions: (Mutable)List<PotentialAction!>!

mResult

protected val mResultLong

mSport

protected val mSportString!

mSportsEventStatus

protected val mSportsEventStatusLong

mSportsEventStatusLabel

protected val mSportsEventStatusLabelString?

mStartDate

protected val mStartDateInstant!

mUrl

protected val mUrlString!