public class User
extends java.lang.Object
Constructor and Description |
---|
User(java.lang.String id,
java.lang.String name,
Role role) |
Modifier and Type | Method and Description |
---|---|
Role |
assertRoleIsAtLeast(java.lang.String resource,
Role role)
Throws an exception if the current Role is equal or more privileged than the
given Role.
|
static User |
from(com.google.gson.JsonObject j) |
java.lang.String |
getId() |
java.lang.String |
getName() |
Role |
getRole() |
com.google.gson.JsonObject |
toJson() |
java.lang.String |
toString() |
public User(java.lang.String id, java.lang.String name, Role role)
public static User from(com.google.gson.JsonObject j) throws OpenemsError.OpenemsNamedException
public java.lang.String getId()
public java.lang.String getName()
public Role getRole()
public java.lang.String toString()
toString
in class java.lang.Object
public com.google.gson.JsonObject toJson()
public Role assertRoleIsAtLeast(java.lang.String resource, Role role) throws OpenemsError.OpenemsNamedException
resource
- a resource identifier; used for the exceptionrole
- the compared RoleOpenemsError.OpenemsNamedException
- if the current Role privileges are less