Class GenericUser

java.lang.Object
org.openhab.core.auth.GenericUser
All Implemented Interfaces:
Principal, User, Identifiable<String>

@NonNullByDefault public class GenericUser extends Object implements User
Represents a generic User with a set of roles
Author:
Yannick Schaus - initial contribution
  • Constructor Details

    • GenericUser

      public GenericUser(String name, Set<String> roles)
      Constructs a user attributed with a set of roles.
      Parameters:
      name - the username (account name)
      roles - the roles attributed to this user
    • GenericUser

      public GenericUser(String name)
      Constructs a user with no roles.
      Parameters:
      name - the username (account name)
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface Principal
    • getUID

      public String getUID()
      Description copied from interface: Identifiable
      Get the unique identifier.
      Specified by:
      getUID in interface Identifiable<String>
      Returns:
      the unique identifier
    • getRoles

      public Set<String> getRoles()
      Description copied from interface: User
      Gets the roles attributed to the user.
      Specified by:
      getRoles in interface User
      Returns:
      role attributed to the user
      See Also: