public class

PrincipalImpl

extends Object
implements Principal
java.lang.Object
   ↳ sun.security.acl.PrincipalImpl

Class Overview

This class implements the principal interface.

Summary

Public Constructors
PrincipalImpl(String user)
Construct a principal from a string user name.
Public Methods
boolean equals(Object another)
This function returns true if the object passed matches the principal represented in this implementation
String getName()
return the name of the principal.
int hashCode()
return a hashcode for the principal.
String toString()
Prints a stringified version of the principal.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.security.Principal

Public Constructors

public PrincipalImpl (String user)

Construct a principal from a string user name.

Parameters
user The string form of the principal name.

Public Methods

public boolean equals (Object another)

This function returns true if the object passed matches the principal represented in this implementation

Parameters
another the Principal to compare with.
Returns
  • true if the Principal passed is the same as that encapsulated in this object, false otherwise

public String getName ()

return the name of the principal.

Returns
  • the name of this principal.

public int hashCode ()

return a hashcode for the principal.

Returns
  • a hash code value for this object.

public String toString ()

Prints a stringified version of the principal.

Returns
  • a string representation of the object.