@Document.BuilderProducer
public final class Account.Builder


Builder for Account.

Summary

Public constructors

Constructor with all the existing values.

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

Constructor for Builder.

Public methods

@NonNull Account

Builds a new Account instance.

@NonNull Account.Builder

Sets the opaque, optional identifier for the account.

@NonNull Account.Builder

Sets the human-readable name of the account.

@NonNull Account.Builder

Sets the type of the account.

Public constructors

Builder

Added in 1.2.0-alpha01
public Builder(@NonNull Account account)

Constructor with all the existing values.

Builder

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

Constructor for Builder.

Parameters
@NonNull String namespace

Namespace for the Document. See Document.Namespace.

@NonNull String id

Unique identifier for the Document. See Document.Id.

Public methods

build

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

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
public @NonNull Account.Builder setAccountId(@NonNull String accountId)

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
public @NonNull Account.Builder setAccountName(@NonNull String accountName)

Sets the human-readable name of the account.

setAccountType

Added in 1.2.0-alpha01
public @NonNull Account.Builder setAccountType(@NonNull String accountType)

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".