Class UserDetailsDto

java.lang.Object
org.localify.auth.dto.UserDetailsDto

public class UserDetailsDto extends Object
Data Transfer Object for user details. This class is used to transfer user details, including roles, between different parts of the application.
  • Constructor Details

    • UserDetailsDto

      public UserDetailsDto()
  • Method Details

    • getRolesAsString

      public String getRolesAsString()
      Gets the user's roles as a comma-separated string.
      Returns:
      The roles as a string.
    • getRoles

      public List<String> getRoles()
      Gets the user's roles as a list of strings.
      Returns:
      A list of roles.
    • getId

      public UUID getId()
      Gets the user's ID.
      Returns:
      The user's ID.
    • setId

      public UserDetailsDto setId(UUID id)
      Sets the user's ID.
      Parameters:
      id - The user's ID.
      Returns:
      This UserDetailsDto instance.
    • isUser

      public boolean isUser()
      Checks if the user has the "User" role.
      Returns:
      True if the user is a user, false otherwise.
    • setUser

      public UserDetailsDto setUser(boolean user)
      Sets whether the user has the "User" role.
      Parameters:
      user - True if the user is a user, false otherwise.
      Returns:
      This UserDetailsDto instance.
    • isAdmin

      public boolean isAdmin()
      Checks if the user has the "Admin" role.
      Returns:
      True if the user is an admin, false otherwise.
    • setAdmin

      public UserDetailsDto setAdmin(boolean admin)
      Sets whether the user has the "Admin" role.
      Parameters:
      admin - True if the user is an admin, false otherwise.
      Returns:
      This UserDetailsDto instance.
    • isTeamMember

      public boolean isTeamMember()
      Checks if the user has the "TeamMember" role.
      Returns:
      True if the user is a team member, false otherwise.
    • setTeamMember

      public UserDetailsDto setTeamMember(boolean teamMember)
      Sets whether the user has the "TeamMember" role.
      Parameters:
      teamMember - True if the user is a team member, false otherwise.
      Returns:
      This UserDetailsDto instance.
    • isSuperAdmin

      public boolean isSuperAdmin()
      Checks if the user has the "SuperAdmin" role.
      Returns:
      True if the user is a super admin, false otherwise.
    • setSuperAdmin

      public UserDetailsDto setSuperAdmin(boolean superAdmin)
      Sets whether the user has the "SuperAdmin" role.
      Parameters:
      superAdmin - True if the user is a super admin, false otherwise.
      Returns:
      This UserDetailsDto instance.