public class Identity
extends Object
implements Principal
Modifier | Constructor and Description |
---|---|
protected |
Identity(String identifier,
Credential credential,
Set<String> roles)
Constructs an instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(Object credential)
Authenticates.
|
String |
getIdentifier()
Gets the identifier.
|
String |
getName() |
Set<String> |
getRoles()
Gets the roles.
|
boolean |
isAuthenticated()
Asks if authenticated.
|
boolean |
isInRoles(String[] roles)
Asks if this identity acts in one of the specified roles.
|
void |
reset()
Resets.
|
String |
toString() |
protected Identity(@Nonnull String identifier, @Nonnull Credential credential, @Nonnull Set<String> roles)
identifier
- The identifier.credential
- The credential.roles
- The roles.@CheckReturnValue public boolean authenticate(@Nonnull Object credential)
credential
- A supplied credential.@Nonnull @CheckReturnValue public String getIdentifier()
public String getName()
getName
in interface Principal
@Nonnull @CheckReturnValue public Set<String> getRoles()
@CheckReturnValue public boolean isAuthenticated()
@CheckReturnValue public boolean isInRoles(@Nonnull String[] roles)
roles
- The roles.public void reset()
public String toString()
toString
in interface Principal
toString
in class Object
Copyright © 2003-2019 Serge Brisson. All Rights Reserved.