public class SamplePrincipal
extends java.lang.Object
implements java.security.Principal, java.io.Serializable
Principal interface to represents a
Sample Principal.| Constructor and Description |
|---|
SamplePrincipal(java.lang.String name)
Create a SamplePrincipal with a name.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object object)
Compares the specified Object with this
SamplePrincipal for
equality. |
java.lang.String |
getName()
Return the name for this
SamplePrincipal. |
int |
hashCode()
Return a hash code for this
SamplePrincipal. |
java.lang.String |
toString()
Return a string representation of this
SamplePrincipal. |
public SamplePrincipal(java.lang.String name)
name - the name for this principal.java.lang.NullPointerException - if the name is null.public java.lang.String getName()
SamplePrincipal.getName in interface java.security.Principalpublic java.lang.String toString()
SamplePrincipal.toString in interface java.security.PrincipaltoString in class java.lang.Objectpublic boolean equals(java.lang.Object object)
SamplePrincipal for
equality.equals in interface java.security.Principalequals in class java.lang.Objectobject - Object to be compared.SamplePrincipal.public int hashCode()
SamplePrincipal.hashCode in interface java.security.PrincipalhashCode in class java.lang.Object