java.security
Interface Principal

All Known Subinterfaces:
Group sample code for java.security.acl.Group definition code for java.security.acl.Group
All Known Implementing Classes:
Identity sample code for java.security.Identity definition code for java.security.Identity , IdentityScope sample code for java.security.IdentityScope definition code for java.security.IdentityScope , JMXPrincipal sample code for javax.management.remote.JMXPrincipal definition code for javax.management.remote.JMXPrincipal , KerberosPrincipal sample code for javax.security.auth.kerberos.KerberosPrincipal definition code for javax.security.auth.kerberos.KerberosPrincipal , Signer sample code for java.security.Signer definition code for java.security.Signer , X500Principal sample code for javax.security.auth.x500.X500Principal definition code for javax.security.auth.x500.X500Principal

public interface Principal

This interface represents the abstract notion of a principal, which can be used to represent any entity, such as an individual, a corporation, and a login id.

See Also:
X509Certificate sample code for java.security.cert.X509Certificate definition code for java.security.cert.X509Certificate

Method Summary
 boolean equals sample code for java.security.Principal.equals(java.lang.Object) definition code for java.security.Principal.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  another)
          Compares this principal to the specified object.
 String sample code for java.lang.String definition code for java.lang.String getName sample code for java.security.Principal.getName() definition code for java.security.Principal.getName() ()
          Returns the name of this principal.
 int hashCode sample code for java.security.Principal.hashCode() definition code for java.security.Principal.hashCode() ()
          Returns a hashcode for this principal.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for java.security.Principal.toString() definition code for java.security.Principal.toString() ()
          Returns a string representation of this principal.
 

Method Detail

equals sample code for java.security.Principal.equals(java.lang.Object) definition code for java.security.Principal.equals(java.lang.Object)

boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  another)
Compares this principal to the specified object. Returns true if the object passed in matches the principal represented by the implementation of this interface.

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
another - principal to compare with.
Returns:
true if the principal passed in is the same as that encapsulated by this principal, and false otherwise.
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

toString sample code for java.security.Principal.toString() definition code for java.security.Principal.toString()

String sample code for java.lang.String definition code for java.lang.String  toString()
Returns a string representation of this principal.

Overrides:
toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a string representation of this principal.

hashCode sample code for java.security.Principal.hashCode() definition code for java.security.Principal.hashCode()

int hashCode()
Returns a hashcode for this principal.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hashcode for this principal.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

getName sample code for java.security.Principal.getName() definition code for java.security.Principal.getName()

String sample code for java.lang.String definition code for java.lang.String  getName()
Returns the name of this principal.

Returns:
the name of this principal.