Package org.apache.sysds.runtime.privacy
Class PrivacyUtils
- java.lang.Object
-
- org.apache.sysds.runtime.privacy.PrivacyUtils
-
public class PrivacyUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description PrivacyUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PrivacyConstraint.PrivacyLevel
getGeneralPrivacyLevel(PrivacyConstraint privacyConstraint)
static PrivacyConstraint.PrivacyLevel[]
getGeneralPrivacyLevels(PrivacyConstraint[] privacyConstraints)
static boolean
privacyConstraintActivated(PrivacyConstraint constraint)
Returns true if the privacy constraint is not null and the privacy level is set to Private or PrivateAggregation.static boolean
privacyConstraintFineGrainedActivated(PrivacyConstraint constraint)
Returns true if the privacy constraint is not null and it has fine-grained constraints.static void
putFineGrainedConstraintsFromString(FineGrainedPrivacy fineGrainedPrivacy, String fgPrivacyValue)
static void
setFineGrainedPrivacy(PrivacyConstraint privacyConstraint, Expression eFineGrainedPrivacy)
static boolean
someConstraintSetBinary(PrivacyConstraint... privacyConstraints)
Returns true if some constraints are set for either of two input privacy constraints.static boolean
someConstraintSetUnary(PrivacyConstraint privacyConstraint)
Returns true if the constraint is set for the input privacy constraint.
-
-
-
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
-
getGeneralPrivacyLevel
public static PrivacyConstraint.PrivacyLevel getGeneralPrivacyLevel(PrivacyConstraint privacyConstraint)
-
getGeneralPrivacyLevels
public static PrivacyConstraint.PrivacyLevel[] getGeneralPrivacyLevels(PrivacyConstraint[] privacyConstraints)
-
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
-
-