Class PrincipalImpl

  • All Implemented Interfaces:
    java.security.Principal

    public class PrincipalImpl
    extends java.lang.Object
    implements java.security.Principal
    This class implements the principal interface.
    • Constructor Summary

      Constructors 
      Constructor Description
      PrincipalImpl​(java.lang.String user)
      Construct a principal from a string user name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object another)
      This function returns true if the object passed matches the principal represented in this implementation
      java.lang.String getName()
      return the name of the principal.
      int hashCode()
      return a hashcode for the principal.
      java.lang.String toString()
      Prints a stringified version of the 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 Detail

      • PrincipalImpl

        public PrincipalImpl​(java.lang.String user)
        Construct a principal from a string user name.
        Parameters:
        user - The string form of the principal name.
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object another)
        This function returns true if the object passed matches the principal represented in this implementation
        Specified by:
        equals in interface java.security.Principal
        Overrides:
        equals in class java.lang.Object
        Parameters:
        another - the Principal to compare with.
        Returns:
        true if the Principal passed is the same as that encapsulated in this object, false otherwise
      • toString

        public java.lang.String toString()
        Prints a stringified version of the principal.
        Specified by:
        toString in interface java.security.Principal
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        return a hashcode for the principal.
        Specified by:
        hashCode in interface java.security.Principal
        Overrides:
        hashCode in class java.lang.Object
      • getName

        public java.lang.String getName()
        return the name of the principal.
        Specified by:
        getName in interface java.security.Principal