Class UserDTO.Builder<S extends UserDTO.Builder>

java.lang.Object
org.apache.gravitino.dto.authorization.UserDTO.Builder<S>
Type Parameters:
S - The type of the builder instance.
Enclosing class:
UserDTO

public static class UserDTO.Builder<S extends UserDTO.Builder> extends Object
Builder class for constructing a UserDTO instance.
  • Field Details

    • name

      protected String name
      The name of the user.
    • roles

      protected List<String> roles
      The roles of the user.
    • audit

      protected AuditDTO audit
      The audit information of the user.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withName

      public S withName(String name)
      Sets the name of the user.
      Parameters:
      name - The name of the user.
      Returns:
      The builder instance.
    • withRoles

      public S withRoles(List<String> roles)
      Sets the roles of the user.
      Parameters:
      roles - The roles of the user.
      Returns:
      The builder instance.
    • withAudit

      public S withAudit(AuditDTO audit)
      Sets the audit information of the user.
      Parameters:
      audit - The audit information of the user.
      Returns:
      The builder instance.
    • build

      public UserDTO build()
      Builds an instance of UserDTO using the builder's properties.
      Returns:
      An instance of UserDTO.
      Throws:
      IllegalArgumentException - If the name or audit are not set.