Class Principal.Builder

java.lang.Object
io.helidon.security.Principal.Builder
All Implemented Interfaces:
Builder<Principal.Builder,Principal>, Supplier<Principal>
Enclosing interface:
Principal

public static final class Principal.Builder extends Object implements Builder<Principal.Builder,Principal>
A fluent API builder for Principal.
  • Method Details

    • build

      public Principal build()
      Description copied from interface: Builder
      Build the instance from this builder.
      Specified by:
      build in interface Builder<Principal.Builder,Principal>
      Returns:
      instance of the built type
    • name

      public Principal.Builder name(String name)
      Principal name.
      Parameters:
      name - name of the principal (e.g. "John Doe"), also used as id, unless explicitly defined
      Returns:
      updated builder instance
    • id

      public Principal.Builder id(String id)
      Principal id.
      Parameters:
      id - id of the principal (e.g. "oid-user-55d45d5sd4"), also used as name, unless explicitly defined
      Returns:
      updated builder instance
    • addAttribute

      public Principal.Builder addAttribute(String key, Object value)
      Add a custom attribute to this principal.
      Parameters:
      key - name of the attribute
      value - value of the attribute, may be null (in that case the key is not added as an attribute)
      Returns:
      updated builder instance