Class JAASUserPrincipal

java.lang.Object
com.spotfire.server.jaas.JAASUserPrincipal
All Implemented Interfaces:
Serializable, Principal

public class JAASUserPrincipal extends Object implements Principal, Serializable
This class can be used as a base class for Principal implementations representing users.
Since:
3.0
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new JAASUserPrincipal instance with the given username.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Compares the specified object with this JAASUserPrincipal instance.
    This method returns the name of the principal.
    int
    Returns the hash code value for the principal.
    The method returns a String representation of this principal.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.security.Principal

    implies
  • Constructor Details

    • JAASUserPrincipal

      public JAASUserPrincipal(String username)
      Creates a new JAASUserPrincipal instance with the given username.
      Parameters:
      username - the username
      Since:
      3.0
  • Method Details

    • getName

      public String getName()
      This method returns the name of the principal.
      Specified by:
      getName in interface Principal
      Returns:
      the name of the principal.
    • hashCode

      public int hashCode()
      Returns the hash code value for the principal. The returned hash code is the same as the hash code for the String containing the name of the principal.
      Specified by:
      hashCode in interface Principal
      Overrides:
      hashCode in class Object
      Returns:
      a hash code
    • equals

      public boolean equals(Object obj)
      Compares the specified object with this JAASUserPrincipal instance. The method returns true if the two objects are of the same concrete subclass of JAASUserPrincipal and they both have the same name. Otherwise, the method returns false.
      Specified by:
      equals in interface Principal
      Overrides:
      equals in class Object
      Parameters:
      obj - an Object to be compared for equality
      Returns:
      true if the specified object is equal to this principal
    • toString

      public String toString()
      The method returns a String representation of this principal.
      Specified by:
      toString in interface Principal
      Overrides:
      toString in class Object
      Returns:
      a String representation of this principal