Class NotSubject

  • All Implemented Interfaces:
    EntitlementSubject

    public class NotSubject
    extends LogicalSubject
    This class wrapped on an Entitlement Subject object to provide boolean NOT. Membership of NotSubject is satisfied in the user is not a member of the nested EntitlementSubject. We @JsonIgnore getESubjects and setESubjects (NOTE the 's' on the end) so that we don't indicate via JSON schema exposed that we take multiple subject types. We extend LogicalSubject but ensure that we are only allowing a single EntitlementSubject to be referenced by this class.
    • Constructor Detail

      • NotSubject

        public NotSubject()
        Constructs NotSubject
      • NotSubject

        public NotSubject​(EntitlementSubject eSubject)
        Constructs NotSubject
        Parameters:
        eSubject - nested EntitlementSubject
      • NotSubject

        public NotSubject​(EntitlementSubject eSubject,
                          String pSubjectName)
        Constructs NotSubject
        Parameters:
        eSubject - eSubject nested EntitlementSubject
        pSubjectName - subject name as used in OpenAM policy, this is relevant only when NotrESubject was created from OpenAM policy Subject
    • Method Detail

      • setESubject

        public void setESubject​(EntitlementSubject eSubject)
        Sets nested EntitlementSubject.
        Parameters:
        eSubject - nested EntitlementSubject.
      • getESubject

        public EntitlementSubject getESubject()
        Returns nested EntitlementSubject.
        Returns:
        nested EntitlementSubject.
      • setPSubjectName

        public void setPSubjectName​(String pSubjectName)
        Sets OpenAM policy Subject name
        Overrides:
        setPSubjectName in class LogicalSubject
        Parameters:
        pSubjectName - subject name as used in OpenAM policy, this is relevant only when NotrESubject was created from OpenAM policy Subject
      • getPSubjectName

        public String getPSubjectName()
        Returns OpenAM policy Subject name
        Overrides:
        getPSubjectName in class LogicalSubject
        Returns:
        subject name as used in OpenAM policy, this is relevant only when NotrESubject was created from OpenAM policy Subject
      • toJSONObject

        public org.json.JSONObject toJSONObject()
                                         throws org.json.JSONException
        Returns JSONObject mapping of the object
        Overrides:
        toJSONObject in class LogicalSubject
        Returns:
        JSONObject mapping of the object
        Throws:
        org.json.JSONException - if can not map to JSONObject
      • toString

        public String toString()
        Returns string representation of the object.
        Overrides:
        toString in class LogicalSubject
        Returns:
        string representation of the object.
      • equals

        public boolean equals​(Object obj)
        Returns true if the passed in object is equal to this object
        Overrides:
        equals in class LogicalSubject
        Parameters:
        obj - object to check for equality
        Returns:
        true if the passed in object is equal to this object
      • hashCode

        public int hashCode()
        Returns hash code of the object
        Overrides:
        hashCode in class LogicalSubject
        Returns:
        hash code of the object