Package org.apache.nifi.authorization
Class User.Builder
java.lang.Object
org.apache.nifi.authorization.User.Builder
- Enclosing class:
User
Builder for Users.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
identifier
(String identifier) Sets the identifier of the builder.Sets the identifier of the builder with a UUID generated from the specified seed string.Sets the identifier of the builder to a random UUID.Sets the identity of the builder.
-
Field Details
-
identifier
-
identity
-
fromUser
private final boolean fromUser
-
-
Constructor Details
-
Builder
public Builder()Default constructor for building a new User. -
Builder
Initializes the builder with the state of the provided user. When using this constructor the identifier field of the builder can not be changed and will result in an IllegalStateException if attempting to do so.- Parameters:
other
- the existing user to initialize from
-
-
Method Details
-
identifier
Sets the identifier of the builder.- Parameters:
identifier
- the identifier to set- Returns:
- the builder
- Throws:
IllegalStateException
- if this method is called when this builder was constructed from an existing User
-
identifierGenerateRandom
Sets the identifier of the builder to a random UUID.- Returns:
- the builder
- Throws:
IllegalStateException
- if this method is called when this builder was constructed from an existing User
-
identifierGenerateFromSeed
Sets the identifier of the builder with a UUID generated from the specified seed string.- Returns:
- the builder
- Throws:
IllegalStateException
- if this method is called when this builder was constructed from an existing User
-
identity
Sets the identity of the builder.- Parameters:
identity
- the identity to set- Returns:
- the builder
-
build
- Returns:
- a new User constructed from the state of the builder
-