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 Summary
Modifier and TypeMethodDescriptionaddAttribute(String key, Object value) Add a custom attribute to this principal.build()Build the instance from this builder.Principal id.Principal name.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Builder
get, identity, updateModifier and TypeMethodDescriptiondefault Principalget()default Principal.Builderidentity()Instance of this builder as the correct type.default Principal.Builderupdate(Consumer<Principal.Builder> consumer) Update the builder in a fluent API way.
-
Method Details
-
build
-
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
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
Add a custom attribute to this principal.- Parameters:
key- name of the attributevalue- value of the attribute, may be null (in that case the key is not added as an attribute)- Returns:
- updated builder instance
-