Class PrivacyUtils


  • public class PrivacyUtils
    extends Object
    • Constructor Detail

      • PrivacyUtils

        public PrivacyUtils()
    • Method Detail

      • privacyConstraintActivated

        public static boolean privacyConstraintActivated​(PrivacyConstraint constraint)
        Returns true if the privacy constraint is not null and the privacy level is set to Private or PrivateAggregation. This only works for the general privacy levels, the fine-grained constraints are not checked!
        Parameters:
        constraint - to check
        Returns:
        true if the privacy constraint is not null and activated
      • privacyConstraintFineGrainedActivated

        public static boolean privacyConstraintFineGrainedActivated​(PrivacyConstraint constraint)
        Returns true if the privacy constraint is not null and it has fine-grained constraints.
        Parameters:
        constraint - to check
        Returns:
        true if the privacy constraint is not null and has fine-grained constraints
      • someConstraintSetBinary

        public static boolean someConstraintSetBinary​(PrivacyConstraint... privacyConstraints)
        Returns true if some constraints are set for either of two input privacy constraints. This only checks first two elements in privacy constraint array.
        Parameters:
        privacyConstraints - input privacy constraints
        Returns:
        true if one of the two constraints are activated
      • someConstraintSetUnary

        public static boolean someConstraintSetUnary​(PrivacyConstraint privacyConstraint)
        Returns true if the constraint is set for the input privacy constraint.
        Parameters:
        privacyConstraint - input to check
        Returns:
        true if any constraint is activated
      • setFineGrainedPrivacy

        public static void setFineGrainedPrivacy​(PrivacyConstraint privacyConstraint,
                                                 Expression eFineGrainedPrivacy)
      • putFineGrainedConstraintsFromString

        public static void putFineGrainedConstraintsFromString​(FineGrainedPrivacy fineGrainedPrivacy,
                                                               String fgPrivacyValue)
                                                        throws org.apache.wink.json4j.JSONException
        Throws:
        org.apache.wink.json4j.JSONException