com.holonplatform.auth.internal

## Class DefaultAccount.AccountBuilder

- java.lang.Object
- - com.holonplatform.auth.internal.DefaultAccount.AccountBuilder

- All Implemented Interfaces:
    Account.Builder
  Enclosing class:
    DefaultAccount

      public static class DefaultAccount.AccountBuilder
      extends Object
      implements Account.Builder

  Default `DefaultAccount.AccountBuilder` implementation

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AccountBuilder(String id)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete 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
    `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
    `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.
    `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.
    `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.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.holonplatform.auth.Account.Builder

      `detail, detail, permission, permission, permissionStrings, withDetail`

- - ### Constructor Detail

    - #### AccountBuilder

          public AccountBuilder(String id)

      Constructor
      Parameters:
        `id` - Account id

  - ### Method Detail

    - #### root

          public Account.Builder root(boolean root)

      Description copied from interface: `Account.Builder`
      Set whether Account is considered a `root` principal, for which permission checking is always skipped, assuming that any permission is granted.
      Specified by:
        `root` in interface `Account.Builder`
      Parameters:
        `root` - `true` to set Account as `root` principal
      Returns:
        this

    - #### details

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

      Description copied from interface: `Account.Builder`
      Set Account details. Any previously setted detail will be discarded.
      Specified by:
        `details` in interface `Account.Builder`
      Parameters:
        `details` - the details to set
      Returns:
        this

    - #### withDetail

          public Account.Builder withDetail(String key,
                                            Object value)

      Description copied from interface: `Account.Builder`
      Add (or replace if given key already exists) an Account detail
      Specified by:
        `withDetail` in interface `Account.Builder`
      Parameters:
        `key` - Key
        `value` - Value
      Returns:
        this

    - #### permissions

          public Account.Builder permissions(Collection<Permission> permissions)

      Description copied from interface: `Account.Builder`
      Set permissions granted to Account. Any previously setted Permission will be discarded.
      Specified by:
        `permissions` in interface `Account.Builder`
      Parameters:
        `permissions` - the permissions to set
      Returns:
        this

    - #### withPermission

          public Account.Builder withPermission(Permission permission)

      Description copied from interface: `Account.Builder`
      Add a permission granted to Account
      Specified by:
        `withPermission` in interface `Account.Builder`
      Parameters:
        `permission` - Permission to add
      Returns:
        this

    - #### permissionStrings

          public Account.Builder permissionStrings(Collection<String> permissions)

      Description copied from interface: `Account.Builder`
      Set permissions granted to Account using String representations. Any previously setted Permission will be discarded.
      Specified by:
        `permissionStrings` in interface `Account.Builder`
      Parameters:
        `permissions` - the permissions strings to set
      Returns:
        this

    - #### withPermission

          public Account.Builder withPermission(String permission)

      Description copied from interface: `Account.Builder`
      Add a permission granted to Account using String representation.
      Specified by:
        `withPermission` in interface `Account.Builder`
      Parameters:
        `permission` - Permission string to add
      Returns:
        this

    - #### enabled

          public Account.Builder enabled(boolean enabled)

      Description copied from interface: `Account.Builder`
      Set whether is enabled (default is `true`)
      Specified by:
        `enabled` in interface `Account.Builder`
      Parameters:
        `enabled` - `true` if enabled
      Returns:
        this

    - #### locked

          public Account.Builder locked(boolean locked)

      Description copied from interface: `Account.Builder`
      Set whether is locked
      Specified by:
        `locked` in interface `Account.Builder`
      Parameters:
        `locked` - `true` if locked
      Returns:
        this

    - #### expired

          public Account.Builder expired(boolean expired)

      Description copied from interface: `Account.Builder`
      Set whether has expired
      Specified by:
        `expired` in interface `Account.Builder`
      Parameters:
        `expired` - `true` if expired
      Returns:
        this

    - #### credentials

          public Account.Builder credentials(Credentials credentials)

      Description copied from interface: `Account.Builder`
      Set Account credentials as a `Credentials` object
      Specified by:
        `credentials` in interface `Account.Builder`
      Parameters:
        `credentials` - Credentials to set
      Returns:
        this
      See Also:
        `Credentials.builder()`

    - #### credentials

          public Account.Builder credentials(Object credentials)

      Description copied from interface: `Account.Builder`
      Set Account credentials
      Specified by:
        `credentials` in interface `Account.Builder`
      Parameters:
        `credentials` - Credentials to set
      Returns:
        this

    - #### build

          public Account build()

      Description copied from interface: `Account.Builder`
      Build Account instance
      Specified by:
        `build` in interface `Account.Builder`
      Returns:
        Account

Copyright © 2019 The Holon Platform. All rights reserved.