UnixPrincipal (Java SE 10 & JDK 10 )
- 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
Principalinterface 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 Summary
Constructors Constructor Description UnixPrincipal(String name)Create a UnixPrincipal with a Unix username.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Compares the specified Object with this
UnixPrincipalfor equality.StringgetName()Return the Unix username for this
UnixPrincipal.inthashCode()Return a hash code for this
UnixPrincipal.StringtoString()Return a string representation of this
UnixPrincipal.
-
-
-
Constructor Detail
-
UnixPrincipal
public UnixPrincipal(String name)
Create a UnixPrincipal with a Unix username.
- Parameters:
name- the Unix username for this user.- Throws:
NullPointerException- if thenameisnull.
-
-
Method Detail
-
getName
public String getName()
Return the Unix username for this
UnixPrincipal.
-
toString
public String toString()
Return a string representation of this
UnixPrincipal.
-
equals
public boolean equals(Object o)
Compares the specified Object with this
UnixPrincipalfor 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 this
UnixPrincipal.- 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)
-
-
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2018, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.