Package org.apache.sysds.runtime.privacy
Class PrivacyConstraint
- java.lang.Object
- 
- org.apache.sysds.runtime.privacy.PrivacyConstraint
 
- 
- All Implemented Interfaces:
- Externalizable,- Serializable
 
 public class PrivacyConstraint extends Object implements Externalizable PrivacyConstraint holds all privacy constraints for data in the system at compile time and runtime.- See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classPrivacyConstraint.PrivacyLevel
 - 
Constructor SummaryConstructors Constructor Description PrivacyConstraint()Basic Constructor with a fine-grained collection based on a list implementation.PrivacyConstraint(FineGrainedPrivacy fineGrainedPrivacyCollection)Constructor with the option to choose between different fine-grained collection implementations.PrivacyConstraint(PrivacyConstraint.PrivacyLevel privacyLevel)Constructor with default fine-grained collection implementation where the entire data object is set to the given privacy level.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)FineGrainedPrivacygetFineGrainedPrivacy()Get fine-grained privacy instance.PrivacyConstraint.PrivacyLevelgetPrivacyLevel()booleanhasConstraints()Return true if any constraints have level Private or PrivateAggregate.booleanhasFineGrainedConstraints()Checks if fine-grained privacy is set for this privacy constraint.booleanhasPrivateElements()Return true if any of the elements has privacy level privatevoidreadExternal(ObjectInput is)voidsetFineGrainedPrivacyConstraints(FineGrainedPrivacy fineGrainedPrivacy)Sets fine-grained privacy for the privacy constraint.voidsetPrivacyLevel(PrivacyConstraint.PrivacyLevel privacyLevel)voidtoJson(org.apache.wink.json4j.JSONObject json)Get privacy constraints and put them into JSON object.StringtoString()voidwriteExternal(ObjectOutput objectOutput)
 
- 
- 
- 
Constructor Detail- 
PrivacyConstraintpublic PrivacyConstraint() Basic Constructor with a fine-grained collection based on a list implementation.
 - 
PrivacyConstraintpublic 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
 
 - 
PrivacyConstraintpublic 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- 
setPrivacyLevelpublic void setPrivacyLevel(PrivacyConstraint.PrivacyLevel privacyLevel) 
 - 
getPrivacyLevelpublic PrivacyConstraint.PrivacyLevel getPrivacyLevel() 
 - 
hasFineGrainedConstraintspublic boolean hasFineGrainedConstraints() Checks if fine-grained privacy is set for this privacy constraint.- Returns:
- true if the privacy constraint has fine-grained constraints.
 
 - 
setFineGrainedPrivacyConstraintspublic 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
 
 - 
getFineGrainedPrivacypublic FineGrainedPrivacy getFineGrainedPrivacy() Get fine-grained privacy instance.- Returns:
- fine-grained privacy instance
 
 - 
hasPrivateElementspublic boolean hasPrivateElements() Return true if any of the elements has privacy level private- Returns:
- true if any element has privacy level private
 
 - 
hasConstraintspublic boolean hasConstraints() Return true if any constraints have level Private or PrivateAggregate.- Returns:
- true if any constraints have level Private or PrivateAggregate
 
 - 
toJsonpublic void toJson(org.apache.wink.json4j.JSONObject json) throws org.apache.wink.json4j.JSONExceptionGet 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
 
 - 
readExternalpublic void readExternal(ObjectInput is) throws IOException - Specified by:
- readExternalin interface- Externalizable
- Throws:
- IOException
 
 - 
writeExternalpublic void writeExternal(ObjectOutput objectOutput) throws IOException - Specified by:
- writeExternalin interface- Externalizable
- Throws:
- IOException
 
 
- 
 
-