Class PrincipalImpl

    • Constructor Detail

      • PrincipalImpl

        public PrincipalImpl​(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​(Object another)
        This function returns true if the object passed matches the principal represented in this implementation
        Specified by:
        equals in interface Principal
        Overrides:
        equals in class 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 String toString()
        Prints a stringified version of the principal.
        Specified by:
        toString in interface Principal
        Overrides:
        toString in class Object
        Returns:
        A java.lang.String object returned by the method getName()
      • hashCode

        public int hashCode()
        Returns the hashcode for this Principal object
        Specified by:
        hashCode in interface Principal
        Overrides:
        hashCode in class Object
        Returns:
        a hashcode for the principal.
      • getName

        public String getName()
        Gets the name of the Principal as a java.lang.String
        Specified by:
        getName in interface Principal
        Returns:
        the name of the principal.