com.holonplatform.auth

## Interface Account.Builder

- All Known Implementing Classes:
    DefaultAccount.AccountBuilder
  Enclosing interface:
    Account

      public static interface Account.Builder

  Builder to create `Account` instances.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `Account` | `build()` Build Account instance
    `Account.Builder` | `credentials(Credentials credentials)` Set Account credentials as a `Credentials` object
    `Account.Builder` | `credentials(Object credentials)` Set Account credentials
    `default <T> Account.Builder` | `detail(ConfigProperty<T> property, T value)` Deprecated. Use `withDetail(ConfigProperty, Object)`
    `default Account.Builder` | `detail(String key, Object value)` Deprecated. Use `withDetail(String, Object)`
    `Account.Builder` | `details(Map<String,Object> details)` Set Account details.
    `Account.Builder` | `enabled(boolean enabled)` Set whether is enabled (default is `true`)
    `Account.Builder` | `expired(boolean expired)` Set whether has expired
    `Account.Builder` | `locked(boolean locked)` Set whether is locked
    `default Account.Builder` | `permission(Permission permission)` Deprecated. Use `withPermission(Permission)`
    `default Account.Builder` | `permission(String permission)` Deprecated. Use `withPermission(String)`
    `Account.Builder` | `permissions(Collection<Permission> permissions)` Set permissions granted to Account.
    `Account.Builder` | `permissionStrings(Collection<String> permissions)` Set permissions granted to Account using String representations.
    `default Account.Builder` | `permissionStrings(String... permissions)` Set permissions granted to Account using String representations.
    `Account.Builder` | `root(boolean root)` Set whether Account is considered a `root` principal, for which permission checking is always skipped, assuming that any permission is granted.
    `default <T> Account.Builder` | `withDetail(ConfigProperty<T> property, T value)` Add (or replace if given key already exists) an Account detail using a `ConfigProperty`.
    `Account.Builder` | `withDetail(String key, Object value)` Add (or replace if given key already exists) an Account detail
    `Account.Builder` | `withPermission(Permission permission)` Add a permission granted to Account
    `Account.Builder` | `withPermission(String permission)` Add a permission granted to Account using String representation.

- - ### Method Detail

    - #### root

          Account.Builder root(boolean root)

      Set whether Account is considered a `root` principal, for which permission checking is always skipped, assuming that any permission is granted.
      Parameters:
        `root` - `true` to set Account as `root` principal
      Returns:
        this

    - #### details

          Account.Builder details(Map<String,Object> details)

      Set Account details. Any previously setted detail will be discarded.
      Parameters:
        `details` - the details to set
      Returns:
        this

    - #### withDetail

          Account.Builder withDetail(String key,
                                     Object value)

      Add (or replace if given key already exists) an Account detail
      Parameters:
        `key` - Key
        `value` - Value
      Returns:
        this

    - #### detail

          @Deprecated
          default Account.Builder detail(String key,
                                                      Object value)

      Deprecated. Use `withDetail(String, Object)`
      Add (or replace if given key already exists) an Account detail
      Parameters:
        `key` - Key
        `value` - Value
      Returns:
        this

    - #### withDetail

          default <T> Account.Builder withDetail(ConfigProperty<T> property,
                                                 T value)

      Add (or replace if given key already exists) an Account detail using a `ConfigProperty`.
      Type Parameters:
        `T` - Config property type
      Parameters:
        `property` - ConfigProperty to use as detail key (not null)
        `value` - Detail value
      Returns:
        this

    - #### detail

          @Deprecated
          default <T> Account.Builder detail(ConfigProperty<T> property,
                                                          T value)

      Deprecated. Use `withDetail(ConfigProperty, Object)`
      Add (or replace if given key already exists) an Account detail using a `ConfigProperty`.
      Type Parameters:
        `T` - Config property type
      Parameters:
        `property` - ConfigProperty to use as detail key (not null)
        `value` - Detail value
      Returns:
        this

    - #### permissions

          Account.Builder permissions(Collection<Permission> permissions)

      Set permissions granted to Account. Any previously setted Permission will be discarded.
      Parameters:
        `permissions` - the permissions to set
      Returns:
        this

    - #### withPermission

          Account.Builder withPermission(Permission permission)

      Add a permission granted to Account
      Parameters:
        `permission` - Permission to add
      Returns:
        this

    - #### permission

          @Deprecated
          default Account.Builder permission(Permission permission)

      Deprecated. Use `withPermission(Permission)`
      Add a permission granted to Account
      Parameters:
        `permission` - Permission to add
      Returns:
        this

    - #### permissionStrings

          Account.Builder permissionStrings(Collection<String> permissions)

      Set permissions granted to Account using String representations. Any previously setted Permission will be discarded.
      Parameters:
        `permissions` - the permissions strings to set
      Returns:
        this

    - #### permissionStrings

          default Account.Builder permissionStrings(String... permissions)

      Set permissions granted to Account using String representations. Any previously setted Permission will be discarded.
      Parameters:
        `permissions` - the permissions strings to set
      Returns:
        this

    - #### withPermission

          Account.Builder withPermission(String permission)

      Add a permission granted to Account using String representation.
      Parameters:
        `permission` - Permission string to add
      Returns:
        this

    - #### permission

          @Deprecated
          default Account.Builder permission(String permission)

      Deprecated. Use `withPermission(String)`
      Add a permission granted to Account using String representation.
      Parameters:
        `permission` - Permission string to add
      Returns:
        this

    - #### enabled

          Account.Builder enabled(boolean enabled)

      Set whether is enabled (default is `true`)
      Parameters:
        `enabled` - `true` if enabled
      Returns:
        this

    - #### locked

          Account.Builder locked(boolean locked)

      Set whether is locked
      Parameters:
        `locked` - `true` if locked
      Returns:
        this

    - #### expired

          Account.Builder expired(boolean expired)

      Set whether has expired
      Parameters:
        `expired` - `true` if expired
      Returns:
        this

    - #### credentials

          Account.Builder credentials(Credentials credentials)

      Set Account credentials as a `Credentials` object
      Parameters:
        `credentials` - Credentials to set
      Returns:
        this
      See Also:
        `Credentials.builder()`

    - #### credentials

          Account.Builder credentials(Object credentials)

      Set Account credentials
      Parameters:
        `credentials` - Credentials to set
      Returns:
        this

    - #### build

          Account build()

      Build Account instance
      Returns:
        Account

Copyright © 2019 The Holon Platform. All rights reserved.