@Document.BuilderProducer
public final class SportsTeam.Builder


Summary

Public constructors

Builder(@NonNull SportsTeam sportsTeam)

Constructor with all the existing values.

Builder(@NonNull String namespace, @NonNull String id, @NonNull String sport)

Constructor for SportsTeam.Builder.

Public methods

@NonNull T

Adds an alias for the item.

@NonNull T

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

@NonNull SportsTeam

Builds a Thing object.

@NonNull SportsOrganization

Builds a Thing object.

@NonNull Organization

Builds a Thing object.

@NonNull Thing

Builds a Thing object.

@NonNull T

Clears the aliases, if any, for the item.

@NonNull T

Clear all the potential actions for this document.

@NonNull T

Sets the accent color of the sports organization as a Color.

@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 formatted record of the sports team. eg: "10 - 5", "10 - 5 (3 - 2)", "10 - 5 (3 - 2) - 1 OT" depending on the sport.

@NonNull T

Sets the URL for an image of the item.

@NonNull T

Sets the logo of the organization.

@NonNull T
setLosses(long losses)

Sets the number of losses of the sports team.

@NonNull T

Sets the name of the item.

@NonNull T
setOvertimeLosses(long overtimeLosses)

Sets the number of overtime losses of the sports team.

@NonNull T
setOvertimeWins(long overtimeWins)

Sets the number of overtime wins of the sports team.

@NonNull T

Sets a list of potential actions for this document.

@NonNull T
setTies(long ties)

Sets the number of ties of the sports team.

@NonNull T

Sets the deeplink URL of the item.

@NonNull T
setWins(long wins)

Sets the number of wins of the sports team.

Protected fields

mAccentColor

protected @Nullable Color mAccentColor

mAlternateNames

protected List<StringmAlternateNames

mCreationTimestampMillis

protected long mCreationTimestampMillis

mDescription

protected String mDescription

mDocumentScore

protected int mDocumentScore

mDocumentTtlMillis

protected long mDocumentTtlMillis

mFormattedRecord

protected @Nullable String mFormattedRecord

mId

protected final String mId

mImage

protected String mImage

mLogo

protected @Nullable ImageObject mLogo

mLosses

protected long mLosses

mName

protected String mName

mNamespace

protected final String mNamespace

mOvertimeLosses

protected long mOvertimeLosses

mOvertimeWins

protected long mOvertimeWins

mPotentialActions

protected List<PotentialActionmPotentialActions

mSport

protected @NonNull String mSport

mTies

protected long mTies

mUrl

protected String mUrl

mWins

protected long mWins

Public constructors

Builder

Added in 1.2.0-alpha01
public Builder(@NonNull SportsTeam sportsTeam)

Constructor with all the existing values.

Builder

Added in 1.2.0-alpha01
public Builder(@NonNull String namespace, @NonNull String id, @NonNull String sport)

Constructor for SportsTeam.Builder.

Parameters
@NonNull String namespace

Namespace for the Document. See Document.Namespace.

@NonNull String id

The unique identifier for the Document.

@NonNull String sport

The sport of the sports team.

Public methods

addAlternateName

Added in 1.2.0-alpha01
public @NonNulladdAlternateName(@NonNull String alternateName)

Adds an alias for the item.

addPotentialAction

Added in 1.2.0-alpha01
@ExperimentalAppSearchApi
public @NonNulladdPotentialAction(@NonNull PotentialAction newPotentialAction)

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

build

Added in 1.2.0-alpha01
public @NonNull SportsTeam build()

Builds a Thing object.

build

Added in 1.2.0-alpha01
public @NonNull SportsOrganization build()

Builds a Thing object.

build

Added in 1.2.0-alpha01
public @NonNull Organization build()

Builds a Thing object.

build

Added in 1.2.0-alpha01
public @NonNull Thing build()

Builds a Thing object.

clearAlternateNames

Added in 1.2.0-alpha01
public @NonNullclearAlternateNames()

Clears the aliases, if any, for the item.

clearPotentialActions

Added in 1.2.0-alpha01
@ExperimentalAppSearchApi
public @NonNullclearPotentialActions()

Clear all the potential actions for this document.

setAccentColor

Added in 1.2.0-alpha01
public @NonNullsetAccentColor(@Nullable Color accentColor)

Sets the accent color of the sports organization as a Color.

Parameters
@Nullable Color accentColor

The accent color of the sports organization.

setAlternateNames

Added in 1.2.0-alpha01
public @NonNullsetAlternateNames(@Nullable List<String> alternateNames)

Sets a list of aliases for the item.

setCreationTimestampMillis

Added in 1.2.0-alpha01
public @NonNullsetCreationTimestampMillis(long creationTimestampMillis)

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
public @NonNullsetDescription(@Nullable String description)

Sets the description for the item.

setDocumentScore

Added in 1.2.0-alpha01
public @NonNullsetDocumentScore(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.

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

setDocumentTtlMillis

Added in 1.2.0-alpha01
public @NonNullsetDocumentTtlMillis(long documentTtlMillis)

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.

setFormattedRecord

Added in 1.2.0-alpha01
public @NonNullsetFormattedRecord(@Nullable String formattedRecord)

Sets the formatted record of the sports team. eg: "10 - 5", "10 - 5 (3 - 2)", "10 - 5 (3 - 2) - 1 OT" depending on the sport.

Parameters
@Nullable String formattedRecord

The formatted record of the sports team.

setImage

Added in 1.2.0-alpha01
@ExperimentalAppSearchApi
public @NonNullsetImage(@Nullable String image)

Sets the URL for an image of the item.

setLogo

Added in 1.2.0-alpha01
public @NonNullsetLogo(@Nullable ImageObject logo)

Sets the logo of the organization.

setLosses

Added in 1.2.0-alpha01
public @NonNullsetLosses(long losses)

Sets the number of losses of the sports team.

Parameters
long losses

The number of losses of the sports team.

setName

Added in 1.2.0-alpha01
public @NonNullsetName(@Nullable String name)

Sets the name of the item.

setOvertimeLosses

Added in 1.2.0-alpha01
public @NonNullsetOvertimeLosses(long overtimeLosses)

Sets the number of overtime losses of the sports team.

Parameters
long overtimeLosses

The number of overtime losses of the sports team.

setOvertimeWins

Added in 1.2.0-alpha01
public @NonNullsetOvertimeWins(long overtimeWins)

Sets the number of overtime wins of the sports team.

Parameters
long overtimeWins

The number of overtime wins of the sports team.

setPotentialActions

Added in 1.2.0-alpha01
@ExperimentalAppSearchApi
public @NonNullsetPotentialActions(@Nullable List<PotentialAction> newPotentialActions)

Sets a list of potential actions for this document.

setTies

Added in 1.2.0-alpha01
public @NonNullsetTies(long ties)

Sets the number of ties of the sports team.

Parameters
long ties

The number of ties of the sports team.

setUrl

Added in 1.2.0-alpha01
public @NonNullsetUrl(@Nullable String url)

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.

setWins

Added in 1.2.0-alpha01
public @NonNullsetWins(long wins)

Sets the number of wins of the sports team.

Parameters
long wins

The number of wins of the sports team.