Class User.Builder<A extends Identity>

java.lang.Object
io.inverno.mod.security.authentication.user.User.Builder<A>
Type Parameters:
A - the identity type
Enclosing class:
User<A extends Identity>

public static class User.Builder<A extends Identity> extends Object

A builder used to build users.

Since:
1.5
Author:
Jeremy Kuhn
  • Method Details

    • identity

      public <B extends Identity> User.Builder<B> identity(B identity)

      Specifies the identity of the user.

      Type Parameters:
      B - the identity type
      Parameters:
      identity - the user identity
      Returns:
      this builder
    • password

      public User.Builder<A> password(Password<?,?> password)

      Specifies the user password.

      Parameters:
      password - the user password
      Returns:
      this builder
    • groups

      public User.Builder<A> groups(String... groups)

      Specifies the user groups.

      Parameters:
      groups - an array of groups
      Returns:
      this builder
    • groups

      public User.Builder<A> groups(Collection<String> groups)

      Specifies the user groups.

      Parameters:
      groups - a collection of groups
      Returns:
      this builder
    • locked

      public User.Builder<A> locked(boolean locked)

      Specifies whether to create a locked user.

      Parameters:
      locked - true to create a locked user, false otherwise
      Returns:
      this builder
    • build

      public User<A> build()

      Builds the user.

      Returns:
      a new user