Class NotCondition

  • All Implemented Interfaces:
    EntitlementCondition

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

      • NotCondition

        public NotCondition()
        Constructs NotCondition
      • NotCondition

        public NotCondition​(EntitlementCondition eCondition)
        Constructs NotCondition
        Parameters:
        eCondition - wrapped EntitlementCondition(s)
      • NotCondition

        public NotCondition​(EntitlementCondition eConditions,
                            String pConditionName)
        Constructs NotCondition.
        Parameters:
        eConditions - wrapped EntitlementCondition(s)
        pConditionName - subject name as used in OpenAM policy, this is relevant only when UserECondition was created from OpenAM policy Condition
    • Method Detail

      • setECondition

        public void setECondition​(EntitlementCondition eCondition)
        Sets the nested EntitlementCondition(s).
        Parameters:
        eCondition - the nested EntitlementCondition(s)
      • getECondition

        public EntitlementCondition getECondition()
        Returns the nested EntitlementCondition(s).
        Returns:
        the nested EntitlementCondition(s).
      • setPConditionName

        public void setPConditionName​(String pConditionName)
        Sets OpenAM policy Condition name
        Overrides:
        setPConditionName in class LogicalCondition
        Parameters:
        pConditionName - subject name as used in OpenAM policy, this is relevant only when UserECondition was created from OpenAM policy Condition
      • getPConditionName

        public String getPConditionName()
        Returns OpenAM policy Condition name
        Overrides:
        getPConditionName in class LogicalCondition
        Returns:
        subject name as used in OpenAM policy, this is relevant only when UserECondition was created from OpenAM policy Condition
      • toJSONObject

        public org.json.JSONObject toJSONObject()
                                         throws org.json.JSONException
        Returns JSONObject mapping of the object
        Overrides:
        toJSONObject in class LogicalCondition
        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 LogicalCondition
        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 LogicalCondition
        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 LogicalCondition
        Returns:
        hash code of the object