Class User.Builder

java.lang.Object
org.apache.nifi.authorization.User.Builder
Enclosing class:
User

public static class User.Builder extends Object
Builder for Users.
  • Field Details

    • identifier

      private String identifier
    • identity

      private String identity
    • fromUser

      private final boolean fromUser
  • Constructor Details

    • Builder

      public Builder()
      Default constructor for building a new User.
    • Builder

      public Builder(User other)
      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

      public User.Builder identifier(String 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

      public User.Builder 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

      public User.Builder identifierGenerateFromSeed(String seed)
      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

      public User.Builder identity(String identity)
      Sets the identity of the builder.
      Parameters:
      identity - the identity to set
      Returns:
      the builder
    • build

      public User build()
      Returns:
      a new User constructed from the state of the builder