class Person.Builder


Builder class for Person.

Summary

Public constructors

Builder(person: Person)

Constructor for Builder with all the existing values of an Person.

Builder(namespace: String, id: String, name: String)

Constructor for Person.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.

Person

Builds the Person.

Thing

Builds a Thing object.

T

Clears the aliases, if any, for the item.

T

Clear all the potential actions for this document.

T

Sets a list of AdditionalName for that Person.

T
setAffiliations(affiliations: (Mutable)List<String!>)

Sets a list of affiliations for this Person.

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

Sets a list of aliases for the item.

T
setBot(isBot: Boolean)

Sets whether this Person is a bot.

T

Sets a list of ContactPoint for the Person.

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
setExternalUri(externalUri: Uri)

Sets an external Uri for this Person.

T
setFamilyName(familyName: String)

Sets the family name of this Person.

T
setGivenName(givenName: String)

Sets the given name of this Person.

T

Sets the URL for an image of the item.

T
setImageUri(imageUri: Uri)

Sets the Uri of the profile image for the Person.

T
setImportant(isImportant: Boolean)

Sets whether this Person is important.

T
setMiddleName(middleName: String)

Sets the middle name of this Person.

T
setName(name: String?)

Sets the name of the item.

T

Sets the notes about this Person.

T

Sets a list of potential actions for this document.

T

Sets a list of relations for this Person, like "Father" or "Mother".

T
setUrl(url: String?)

Sets the deeplink URL of the item.

Public constructors

Builder

Added in 1.1.0-alpha07
Builder(person: Person)

Constructor for Builder with all the existing values of an Person.

Builder

Added in 1.1.0-alpha07
Builder(namespace: String, id: String, name: String)

Constructor for Person.Builder.

Parameters
namespace: String

Namespace for the Person Document. See Document.Namespace.

id: String

Unique identifier for the Person Document. See Document.Id.

name: String

The searchable full name of this Person. E.g. "Larry Page", or "Page, Larry".

Public functions

addAlternateName

Added in 1.1.0-alpha07
fun addAlternateName(alternateName: String): T

Adds an alias for the item.

addPotentialAction

Added in 1.1.0-alpha07
@ExperimentalAppSearchApi
fun addPotentialAction(newPotentialAction: PotentialAction): T

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

build

Added in 1.1.0-alpha07
fun build(): Person

Builds the Person.

build

Added in 1.1.0-alpha07
fun build(): Thing

Builds a Thing object.

clearAlternateNames

Added in 1.1.0-alpha07
fun clearAlternateNames(): T

Clears the aliases, if any, for the item.

clearPotentialActions

Added in 1.1.0-alpha07
@ExperimentalAppSearchApi
fun clearPotentialActions(): T

Clear all the potential actions for this document.

setAdditionalNames

Added in 1.1.0-alpha07
fun setAdditionalNames(
    additionalNames: (Mutable)List<Person.AdditionalName!>
): T

Sets a list of AdditionalName for that Person.

Only types defined in AdditionalName.NameType are accepted.

setAffiliations

Added in 1.1.0-alpha07
fun setAffiliations(affiliations: (Mutable)List<String!>): T

Sets a list of affiliations for this Person. Like company, school, etc.

setAlternateNames

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

Sets a list of aliases for the item.

setBot

Added in 1.1.0-alpha07
fun setBot(isBot: Boolean): T

Sets whether this Person is a bot.

setContactPoints

Added in 1.1.0-alpha07
fun setContactPoints(contactPoints: (Mutable)List<ContactPoint!>): T

Sets a list of ContactPoint for the Person.

More information could be found in ContactPoint.

setCreationTimestampMillis

Added in 1.1.0-alpha07
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.1.0-alpha07
fun setDescription(description: String?): T

Sets the description for the item.

setDocumentScore

Added in 1.1.0-alpha07
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.1.0-alpha07
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.

setExternalUri

Added in 1.1.0-alpha07
fun setExternalUri(externalUri: Uri): T

Sets an external Uri for this Person. Or null if no Uri is provided. A Uri can be any of the following:

For mailto: and tel: URI schemes, it is recommended that the path portion refers to a valid contact in the Contacts Provider.

setFamilyName

Added in 1.1.0-alpha07
fun setFamilyName(familyName: String): T

Sets the family name of this Person.

setGivenName

Added in 1.1.0-alpha07
fun setGivenName(givenName: String): T

Sets the given name of this Person.

setImage

Added in 1.1.0-alpha07
@ExperimentalAppSearchApi
fun setImage(image: String?): T

Sets the URL for an image of the item.

setImageUri

Added in 1.1.0-alpha07
fun setImageUri(imageUri: Uri): T

Sets the Uri of the profile image for the Person.

setImportant

Added in 1.1.0-alpha07
fun setImportant(isImportant: Boolean): T

Sets whether this Person is important.

setMiddleName

Added in 1.1.0-alpha07
fun setMiddleName(middleName: String): T

Sets the middle name of this Person.

For Person with multiple middle names, they can all be set in this single string. Each middle name could be separated by a whitespace like "middleName1 middleName2 middleName3".

setName

Added in 1.1.0-alpha07
fun setName(name: String?): T

Sets the name of the item.

setNotes

Added in 1.1.0-alpha07
fun setNotes(notes: (Mutable)List<String!>): T

Sets the notes about this Person.

setPotentialActions

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

Sets a list of potential actions for this document.

setRelations

Added in 1.1.0-alpha07
fun setRelations(relations: (Mutable)List<String!>): T

Sets a list of relations for this Person, like "Father" or "Mother".

setUrl

Added in 1.1.0-alpha07
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!>!

mCreationTimestampMillis

protected val mCreationTimestampMillisLong

mDescription

protected val mDescriptionString!

mDocumentScore

protected val mDocumentScoreInt

mDocumentTtlMillis

protected val mDocumentTtlMillisLong

mId

protected val mIdString!

mImage

protected val mImageString!

mName

protected val mNameString!

mNamespace

protected val mNamespaceString!

mPotentialActions

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

mUrl

protected val mUrlString!