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 simpleStringname.- Author:
- David M. Lloyd
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private Stringnameprivate static longserialVersionUID
-
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 booleanequals(Object obj)Determine whether this principal is equal to the given object.booleanequals(NamePrincipal obj)Determine whether this principal is equal to the given object.StringgetName()Get the principal name.inthashCode()Get the hash code of this principal.StringtoString()Get a string representation of this principal.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
name
private final String name
-
-
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:
trueif they are equal,falseotherwise
-
-