Class NamePrincipal
java.lang.Object
org.wildfly.security.auth.principal.NamePrincipal
- All Implemented Interfaces:
Serializable,Principal
A principal which is comprised of a simple
String name.- Author:
- David M. Lloyd
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine whether this principal is equal to the given object.booleanequals(NamePrincipal obj) Determine whether this principal is equal to the given object.static NamePrincipalAttempt to convert the given principal to aNamePrincipal.getName()Get the principal name.inthashCode()Get the hash code of this principal.static booleanisConvertibleTo(Principal principal) Check if the given principal could be converted to aNamePrincipal.toString()Get a string representation of this principal.
-
Constructor Details
-
NamePrincipal
Construct a new instance.- Parameters:
name- the principal name
-
-
Method Details
-
getName
Get the principal name. -
hashCode
public int hashCode()Get the hash code of this principal. -
equals
Determine whether this principal is equal to the given object. -
equals
Determine whether this principal is equal to the given object.- Parameters:
obj- the object- Returns:
trueif they are equal,falseotherwise
-
toString
Get a string representation of this principal. -
from
Attempt to convert the given principal to aNamePrincipal.- Parameters:
principal- the original principal- Returns:
- the
NamePrincipalornullif the principal cannot be converted
-
isConvertibleTo
Check if the given principal could be converted to aNamePrincipal.- Parameters:
principal- the original principal- Returns:
trueif the principal can be converted to aNamePrincipalandfalseotherwise
-