Interface Principal

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean equals​(Object another)
      Compares this principal to the specified object.
      String getName()
      Returns the name of this principal.
      int hashCode()
      Returns a hashcode for this principal.
      boolean implies​(Subject subject)
      Even though a subject does not explicitly hold a principal, it may still be implied by the subject.
      String toString()
      Returns a string representation of this principal.
    • Method Detail

      • equals

        boolean equals​(Object another)
        Compares this principal to the specified object. Returns true if the object passed in matches the principal represented by the implementation of this interface.
        Overrides:
        equals in class Object
        Parameters:
        another - principal to compare with.
        Returns:
        true if the principal passed in is the same as this principal, false otherwise.
      • toString

        String toString()
        Returns a string representation of this principal.
        Overrides:
        toString in class Object
        Returns:
        a string representation of this principal.
      • hashCode

        int hashCode()
        Returns a hashcode for this principal.
        Overrides:
        hashCode in class Object
        Returns:
        a hashcode for this principal.
      • getName

        String getName()
        Returns the name of this principal.
        Returns:
        the name of this principal.
      • implies

        boolean implies​(Subject subject)
        Even though a subject does not explicitly hold a principal, it may still be implied by the subject. For example a 'read' and a 'write' principal, if the subject only holds the 'write' principal it is only logical it also implies the 'read' principal. Note principals don't have actions like permissions, the term 'read' principal is used to describe a principal containing a set of permissions granting a render action, just like the 'write' principal contains the same set of permissions only granting the enable action.
        Parameters:
        subject - a subject or null if no user has logged in yet
        Returns:
        true if the subject in any way implies this principal, false otherwise.