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.
        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.
        privacyLevel - for the entire data object.
    • Method Detail

      • hasFineGrainedConstraints

        public boolean hasFineGrainedConstraints()
        Checks if fine-grained privacy is set for this privacy constraint.
        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.
        fineGrainedPrivacy - fine-grained privacy instance which is set for the privacy constraint
      • getFineGrainedPrivacy

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

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

        public boolean hasConstraints()
        Return true if any constraints have level Private or PrivateAggregate.
        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.
        json - JSON object in which the privacy constraints are put
        org.apache.wink.json4j.JSONException - in case of errors in putting into JSON object