After successful authentication, a user java.
can be associated with a particular javax.
to augment that Subject with an additional identity.
Authorization decisions can then be based upon the
Principals that are associated with a Subject.
This class is immutable.
| Modifier and Type | Field and Description |
|---|---|
| private final String | name
The principal's name |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if they are equal; false otherwise.The object to compare this principal against. object)Overrides java. Implements java. Compares this principal to the specified object. |
| public String | Returns: The principal's name.Implements java. Returns the name of this principal. |
| public int | Returns: The principal's hash code.Overrides java. Implements java. Returns a hash code for this principal. |
| private void | readObject(ObjectInputStream
the stream)ObjectInputStream from which data is readRestores the state of this object from the stream. |
| public String | Returns: The principal's name.Overrides java. Implements java. Returns a string representation of this principal. |
| name | back to summary |
|---|---|
| private final String name The principal's name | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID
| |
| UserPrincipal | back to summary |
|---|---|
| public UserPrincipal(String name) Creates a principal.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Implements java. Compares this principal to the specified object.
| |
| getName | back to summary |
|---|---|
| public String getName() Implements java. Returns the name of this principal.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Returns a hash code for this principal.
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException Restores the state of this object from the stream.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Implements java. Returns a string representation of this principal.
| |