java.lang.Object
com.sun.security.auth.UnixPrincipal
- All Implemented Interfaces:
Serializable,Principal
public class UnixPrincipal extends Object implements Principal, Serializable
This class implements the
Principal interface
and represents a Unix user.
Principals such as this UnixPrincipal
may be associated with a particular Subject
to augment that Subject with an additional
identity. Refer to the Subject class for more information
on how to achieve this. Authorization decisions can then be based upon
the Principals associated with a Subject.
- See Also:
Principal,Subject, Serialized Form
-
Constructor Summary
Constructors Constructor Description UnixPrincipal(String name)Create a UnixPrincipal with a Unix username. -
Method Summary
Modifier and Type Method Description booleanequals(Object o)Compares the specified Object with thisUnixPrincipalfor equality.StringgetName()Return the Unix username for thisUnixPrincipal.inthashCode()Return a hash code for thisUnixPrincipal.StringtoString()Return a string representation of thisUnixPrincipal.
-
Constructor Details
-
UnixPrincipal
Create a UnixPrincipal with a Unix username.- Parameters:
name- the Unix username for this user.- Throws:
NullPointerException- if thenameisnull.
-
-
Method Details
-
getName
Return the Unix username for thisUnixPrincipal. -
toString
Return a string representation of thisUnixPrincipal. -
equals
Compares the specified Object with thisUnixPrincipalfor equality. Returns true if the given object is also aUnixPrincipaland the two UnixPrincipals have the same username. -
hashCode
public int hashCode()Return a hash code for thisUnixPrincipal.- Specified by:
hashCodein interfacePrincipal- Overrides:
hashCodein classObject- Returns:
- a hash code for this
UnixPrincipal. - See Also:
Object.equals(java.lang.Object),System.identityHashCode(java.lang.Object)
-