Class SimplePrincipal

  • All Implemented Interfaces:
    java.io.Serializable, org.apereo.cas.authentication.principal.Principal

    public class SimplePrincipal
    extends java.lang.Object
    implements org.apereo.cas.authentication.principal.Principal
    Simple implementation of a Principal that exposes an unmodifiable map of attributes. The attributes are cached upon construction and will not be updated unless the principal is entirely and newly resolved again.
    Since:
    3.1
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SimplePrincipal​(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> attributes)
      Instantiates a new simple principal.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.util.Map<java.lang.String,java.lang.Object> getAttributes()  
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apereo.cas.authentication.principal.Principal

        getId
    • Constructor Detail

      • SimplePrincipal

        protected SimplePrincipal​(@NonNull
                                  java.lang.String id,
                                  java.util.Map<java.lang.String,java.lang.Object> attributes)
        Instantiates a new simple principal.
        Parameters:
        id - the id
        attributes - the attributes
    • Method Detail

      • getAttributes

        public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
        Specified by:
        getAttributes in interface org.apereo.cas.authentication.principal.Principal
        Returns:
        An immutable map of principal attributes
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object