@Document.BuilderProducer
class Account.Builder


Builder for Account.

Summary

Public constructors

Builder(account: Account)

Constructor with all the existing values.

Builder(namespace: String, id: String)

Constructor for Builder.

Public functions

Account

Builds a new Account instance.

Account.Builder
setAccountId(accountId: String)

Sets the opaque, optional identifier for the account.

Account.Builder
setAccountName(accountName: String)

Sets the human-readable name of the account.

Account.Builder
setAccountType(accountType: String)

Sets the type of the account.

Public constructors

Builder

Added in 1.2.0-alpha01
Builder(account: Account)

Constructor with all the existing values.

Builder

Added in 1.2.0-alpha01
Builder(namespace: String, id: String)

Constructor for Builder.

Parameters
namespace: String

Namespace for the Document. See Document.Namespace.

id: String

Unique identifier for the Document. See Document.Id.

Public functions

build

Added in 1.2.0-alpha01
fun build(): Account

Builds a new Account instance.

Throws
java.lang.IllegalArgumentException

If the validation checks fail. This occurs if:

  • **accountType is an empty string.**
  • **Both accountName and accountId are empty strings.**
**The constructor requires a non-empty accountType and at least one of** **accountName or accountId to be non-empty.**

setAccountId

Added in 1.2.0-alpha01
fun setAccountId(accountId: String): Account.Builder

Sets the opaque, optional identifier for the account. This is the unique ID assigned to the account by service provider (the Authenticator) itself (for example, a Service-Specific User ID). It is used for authentication and service interaction.

setAccountName

Added in 1.2.0-alpha01
fun setAccountName(accountName: String): Account.Builder

Sets the human-readable name of the account.

setAccountType

Added in 1.2.0-alpha01
fun setAccountType(accountType: String): Account.Builder

Sets the type of the account. This is typically the package name or a unique identifier of the app or system that owns and manages this account. Example: "com.your.app".