Class PrivacyConstraint

    • Constructor Detail

      • PrivacyConstraint

        public PrivacyConstraint()
        Basic Constructor with a fine-grained collection based on a list implementation.
      • PrivacyConstraint

        public PrivacyConstraint​(FineGrainedPrivacy fineGrainedPrivacyCollection)
        Constructor with the option to choose between different fine-grained collection implementations.
        Parameters:
        fineGrainedPrivacyCollection - the instance in which fine-grained constraints are stored
      • PrivacyConstraint

        public PrivacyConstraint​(PrivacyConstraint.PrivacyLevel privacyLevel)
        Constructor with default fine-grained collection implementation where the entire data object is set to the given privacy level.
        Parameters:
        privacyLevel - for the entire data object.
    • Method Detail

      • hasFineGrainedConstraints

        public boolean hasFineGrainedConstraints()
        Checks if fine-grained privacy is set for this privacy constraint.
        Returns:
        true if the privacy constraint has fine-grained constraints.
      • setFineGrainedPrivacyConstraints

        public void setFineGrainedPrivacyConstraints​(FineGrainedPrivacy fineGrainedPrivacy)
        Sets fine-grained privacy for the privacy constraint. Existing fine-grained privacy collection will be overwritten.
        Parameters:
        fineGrainedPrivacy - fine-grained privacy instance which is set for the privacy constraint
      • getFineGrainedPrivacy

        public FineGrainedPrivacy getFineGrainedPrivacy()
        Get fine-grained privacy instance.
        Returns:
        fine-grained privacy instance
      • hasPrivateElements

        public boolean hasPrivateElements()
        Return true if any of the elements has privacy level private
        Returns:
        true if any element has privacy level private
      • hasConstraints

        public boolean hasConstraints()
        Return true if any constraints have level Private or PrivateAggregate.
        Returns:
        true if any constraints have level Private or PrivateAggregate
      • toJson

        public void toJson​(org.apache.wink.json4j.JSONObject json)
                    throws org.apache.wink.json4j.JSONException
        Get privacy constraints and put them into JSON object.
        Parameters:
        json - JSON object in which the privacy constraints are put
        Throws:
        org.apache.wink.json4j.JSONException - in case of errors in putting into JSON object