public final class NamePrincipal extends Object implements Principal, Serializable
String name.| Constructor and Description |
|---|
NamePrincipal(String name)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(NamePrincipal obj)
Determine whether this principal is equal to the given object.
|
boolean |
equals(Object obj)
Determine whether this principal is equal to the given object.
|
static NamePrincipal |
from(Principal principal)
Attempt to convert the given principal to a
NamePrincipal. |
String |
getName()
Get the principal name.
|
int |
hashCode()
Get the hash code of this principal.
|
static boolean |
isConvertibleTo(Principal principal)
Check if the given principal could be converted to a
NamePrincipal. |
String |
toString()
Get a string representation of this principal.
|
public NamePrincipal(String name)
name - the principal namepublic String getName()
public int hashCode()
public boolean equals(Object obj)
public boolean equals(NamePrincipal obj)
obj - the objecttrue if they are equal, false otherwisepublic String toString()
public static NamePrincipal from(Principal principal)
NamePrincipal.principal - the original principalNamePrincipal or null if the principal cannot be convertedpublic static boolean isConvertibleTo(Principal principal)
NamePrincipal.principal - the original principaltrue if the principal can be converted to a NamePrincipal and false otherwiseCopyright © 2023 JBoss by Red Hat. All rights reserved.