com.holonplatform.auth.internal

## Class DefaultAuthentication.AuthenticationBuilder

- java.lang.Object
- - com.holonplatform.auth.internal.DefaultAuthentication.AuthenticationBuilder

- All Implemented Interfaces:
    Authentication.Builder
  Enclosing class:
    DefaultAuthentication

      public static class DefaultAuthentication.AuthenticationBuilder
      extends Object
      implements Authentication.Builder

  Default `Authentication.Builder` implementation.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AuthenticationBuilder(String principalName)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Authentication` | `build()` Create Authentication instance
    `Authentication.Builder` | `root(boolean root)` Set whether authentication is considered a `root` principal, for which permission checking is always skipped, assuming that any permission is granted.
    `Authentication.Builder` | `scheme(String scheme)` Set the authentication scheme with which this authentication was produced.
    `<T> Authentication.Builder` | `withParameter(ConfigProperty<T> property, T value)` Add an authentication parameter using a `ConfigProperty` an `ConfigProperty.getKey()` as parameter name
    `Authentication.Builder` | `withParameter(String name, Object value)` Add an authentication parameter.
    `Authentication.Builder` | `withPermission(Permission permission)` Add a permission granted to Authentication
    `Authentication.Builder` | `withPermission(String permission)` Add a permission granted to Authentication 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.Authentication.Builder

      `parameter, parameter, permission, permission`

- - ### Constructor Detail

    - #### AuthenticationBuilder

          public AuthenticationBuilder(String principalName)

      Constructor
      Parameters:
        `principalName` - Principal name (not null)

  - ### Method Detail

    - #### scheme

          public Authentication.Builder scheme(String scheme)

      Description copied from interface: `Authentication.Builder`
      Set the authentication scheme with which this authentication was produced.
      Specified by:
        `scheme` in interface `Authentication.Builder`
      Parameters:
        `scheme` - Authentication scheme name
      Returns:
        this

    - #### root

          public Authentication.Builder root(boolean root)

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

    - #### withParameter

          public Authentication.Builder withParameter(String name,
                                                      Object value)

      Description copied from interface: `Authentication.Builder`
      Add an authentication parameter.
      Specified by:
        `withParameter` in interface `Authentication.Builder`
      Parameters:
        `name` - Parameter name (not null)
        `value` - Parameter value
      Returns:
        this

    - #### withParameter

          public <T> Authentication.Builder withParameter(ConfigProperty<T> property,
                                                          T value)

      Description copied from interface: `Authentication.Builder`
      Add an authentication parameter using a `ConfigProperty` an `ConfigProperty.getKey()` as parameter name
      Specified by:
        `withParameter` in interface `Authentication.Builder`
      Type Parameters:
        `T` - Property type
      Parameters:
        `property` - ConfigProperty to obtain parameter name (not null)
        `value` - Parameter value
      Returns:
        this

    - #### withPermission

          public Authentication.Builder withPermission(Permission permission)

      Description copied from interface: `Authentication.Builder`
      Add a permission granted to Authentication
      Specified by:
        `withPermission` in interface `Authentication.Builder`
      Parameters:
        `permission` - Permission to add (not null)
      Returns:
        this

    - #### withPermission

          public Authentication.Builder withPermission(String permission)

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

    - #### build

          public Authentication build()

      Description copied from interface: `Authentication.Builder`
      Create Authentication instance
      Specified by:
        `build` in interface `Authentication.Builder`
      Returns:
        Authentication

Copyright © 2019 The Holon Platform. All rights reserved.