Package overit.geocall.basic.anonymizer
Class Anonymizer.TimeAnonymizer
java.lang.Object
overit.geocall.basic.anonymizer.Anonymizer.AbstractAnonymizer<Date,Anonymizer.TimeAnonymizer>
overit.geocall.basic.anonymizer.Anonymizer.TimeAnonymizer
- Enclosing class:
Anonymizer
public class Anonymizer.TimeAnonymizer
extends Anonymizer.AbstractAnonymizer<Date,Anonymizer.TimeAnonymizer>
Anonymizer used to obfuscate a fields containing time values.
If the context doesn't contains the field assigned to this instance, all'the method of this class will not change the context.
-
Field Summary
Fields inherited from class overit.geocall.basic.anonymizer.Anonymizer.AbstractAnonymizer
_field -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet a random Time (betweenDateUtils.TIME_MINandDateUtils.TIME_MAX) as value of the field assigned to this instance.anonymize(long offset) Generate a random time within the neighbourhood of the current field's value and set it as value of the field assigned to this instance.Generate a random Date between a given range and set it as value of the field assigned to this instance.Methods inherited from class overit.geocall.basic.anonymizer.Anonymizer.AbstractAnonymizer
setValue, validate
-
Constructor Details
-
TimeAnonymizer
-
-
Method Details
-
anonymize
Set a random Time (betweenDateUtils.TIME_MINandDateUtils.TIME_MAX) as value of the field assigned to this instance.- Returns:
- a reference of this object.
-
anonymize
Generate a random time within the neighbourhood of the current field's value and set it as value of the field assigned to this instance.- Parameters:
offset- the size of the neighbourhood expressed as milliseconds. The random value wil be included betweencurrentValueTimestamp - offsetandcurrentValueTimestamp + offset- Returns:
- a reference of this object.
- Throws:
overit.geocall.asserts.AssertsException- if offset is negative.
-
anonymize
Generate a random Date between a given range and set it as value of the field assigned to this instance.- Parameters:
from- the lower bound date (included).to- the lower upper date (excluded).- Returns:
- a reference of this object.
- Throws:
overit.geocall.asserts.AssertsException- if lower bound date is greater equals than the upper bound ones.
-