Class NamePrincipal
- java.lang.Object
-
- org.wildfly.security.auth.principal.NamePrincipal
-
- All Implemented Interfaces:
Serializable
,Principal
public final class NamePrincipal extends Object implements Principal, Serializable
A principal which is comprised of a simpleString
name.- Author:
- David M. Lloyd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NamePrincipal(String name)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Determine whether this principal is equal to the given object.boolean
equals(NamePrincipal obj)
Determine whether this principal is equal to the given object.String
getName()
Get the principal name.int
hashCode()
Get the hash code of this principal.String
toString()
Get a string representation of this principal.
-
-
-
Constructor Detail
-
NamePrincipal
public NamePrincipal(String name)
Construct a new instance.- Parameters:
name
- the principal name
-
-
Method Detail
-
getName
public String getName()
Get the principal name.
-
hashCode
public int hashCode()
Get the hash code of this principal.
-
equals
public boolean equals(Object obj)
Determine whether this principal is equal to the given object.
-
equals
public boolean equals(NamePrincipal obj)
Determine whether this principal is equal to the given object.- Parameters:
obj
- the object- Returns:
true
if they are equal,false
otherwise
-
-