Package org.apache.nifi.authorization
Class Group.Builder
java.lang.Object
org.apache.nifi.authorization.Group.Builder
- Enclosing class:
Group
Builder for creating Groups.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds the given user to the builder's set of users.Adds all users from the provided set to the builder's set of users.build()
Clears the builder's set of users so that users is non-null with size 0.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 name of the builder.removeUser
(String user) Removes the given user from the builder's set of users.removeUsers
(Set<String> users) Removes all users from the provided set from the builder's set of users.
-
Field Details
-
identifier
-
name
-
users
-
fromGroup
private final boolean fromGroup
-
-
Constructor Details
-
Builder
public Builder() -
Builder
Initializes the builder with the state of the provided group. 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 access policy to initialize from
-
-
Method Details
-
identifier
Sets the identifier of the builder.- Parameters:
identifier
- the identifier- Returns:
- the builder
- Throws:
IllegalStateException
- if this method is called when this builder was constructed from an existing Group
-
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 Group
-
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 Group
-
name
Sets the name of the builder.- Parameters:
name
- the name- Returns:
- the builder
-
addUsers
Adds all users from the provided set to the builder's set of users.- Parameters:
users
- a set of users to add- Returns:
- the builder
-
addUser
Adds the given user to the builder's set of users.- Parameters:
user
- the user to add- Returns:
- the builder
-
removeUser
Removes the given user from the builder's set of users.- Parameters:
user
- the user to remove- Returns:
- the builder
-
removeUsers
Removes all users from the provided set from the builder's set of users.- Parameters:
users
- the users to remove- Returns:
- the builder
-
clearUsers
Clears the builder's set of users so that users is non-null with size 0.- Returns:
- the builder
-
build
- Returns:
- a new Group constructed from the state of the builder
-