- java.lang.Object
- 
- com.sun.security.auth.UnixPrincipal
 
- 
- All Implemented Interfaces:
- Serializable,- Principal
 
 public class UnixPrincipal extends Object implements Principal, Serializable This class implements thePrincipalinterface and represents a Unix user.Principals such as this UnixPrincipalmay be associated with a particularSubjectto augment thatSubjectwith an additional identity. Refer to theSubjectclass for more information on how to achieve this. Authorization decisions can then be based upon the Principals associated with aSubject.- See Also:
- Principal,- Subject, Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description UnixPrincipal(String name)Create a UnixPrincipal with a Unix username.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods 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 Detail- 
UnixPrincipalpublic UnixPrincipal(String name) Create a UnixPrincipal with a Unix username.- Parameters:
- name- the Unix username for this user.
- Throws:
- NullPointerException- if the- nameis- null.
 
 
- 
 - 
Method Detail- 
getNamepublic String getName() Return the Unix username for thisUnixPrincipal.
 - 
toStringpublic String toString() Return a string representation of thisUnixPrincipal.
 - 
equalspublic boolean equals(Object o) Compares the specified Object with thisUnixPrincipalfor equality. Returns true if the given object is also aUnixPrincipaland the two UnixPrincipals have the same username.
 - 
hashCodepublic int hashCode() Return a hash code for thisUnixPrincipal.- Specified by:
- hashCodein interface- Principal
- Overrides:
- hashCodein class- Object
- Returns:
- a hash code for this UnixPrincipal.
- See Also:
- Object.equals(java.lang.Object),- System.identityHashCode(java.lang.Object)
 
 
- 
 
-