Class RolePrincipal

java.lang.Object
org.postgresql.pljava.RolePrincipal
All Implemented Interfaces:
Serializable, Principal
Direct Known Subclasses:
RolePrincipal.Authenticated, RolePrincipal.Current, RolePrincipal.Outer, RolePrincipal.Session

public abstract class RolePrincipal extends Object
See Also:
  • Field Details

  • Method Details

    • equals

      public final boolean equals(Object other)
      Compare two RolePrincipals for equality, with special treatment for the PUBLIC ones.

      Each concrete subclass of RolePrincipal has a singleton PUBLIC instance, which will only compare equal to itself (this method is not the place to say everything matches PUBLIC, because equals should be symmetric, and security checks should not be). Otherwise, the result is that of Identifier.equals.

      Note that these PUBLIC instances are distinct from the wild-card principal names that can appear in the Java policy file: those are handled without ever instantiating the class, and simply match any principal with the identically-spelled class name.

      Specified by:
      equals in interface Principal
    • toString

      public String toString()
      Specified by:
      toString in interface Principal
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Principal
      Overrides:
      hashCode in class Object
    • getName

      public String getName()
      Specified by:
      getName in interface Principal