Package overit.geocall.basic.anonymizer
Class Anonymizer.IntegerAnonymizer
java.lang.Object
overit.geocall.basic.anonymizer.Anonymizer.AbstractAnonymizer<Integer,Anonymizer.IntegerAnonymizer>
overit.geocall.basic.anonymizer.Anonymizer.IntegerAnonymizer
- Enclosing class:
Anonymizer
public class Anonymizer.IntegerAnonymizer
extends Anonymizer.AbstractAnonymizer<Integer,Anonymizer.IntegerAnonymizer>
Anonymizer used to obfuscate a fields containing integer 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 integer (betweenInteger.MIN_VALUEandInteger.MAX_VALUE) as value of the field assigned to this instance.anonymize(int offset) Generate a random integer number within the neighbourhood of the current field's value and set it as value of the field assigned to this instance.anonymize(int from, int to) Generate a random integer number between a given range and set it as value of the field assigned to this instance.protected Anonymizer.IntegerAnonymizerMethods inherited from class overit.geocall.basic.anonymizer.Anonymizer.AbstractAnonymizer
setValue, validate
-
Constructor Details
-
IntegerAnonymizer
-
-
Method Details
-
anonymize
Set a random integer (betweenInteger.MIN_VALUEandInteger.MAX_VALUE) as value of the field assigned to this instance.- Returns:
- a reference of this object.
-
anonymize
Generate a random integer number 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. The random value wil be included betweencurrentValue - offsetandcurrentValue + offset- Returns:
- a reference of this object.
- Throws:
overit.geocall.asserts.AssertsException- if offset is negative.
-
anonymize
Generate a random integer number between a given range and set it as value of the field assigned to this instance.- Parameters:
from- the lower bound value (included).to- the lower upper value (excluded).- Returns:
- a reference of this object.
- Throws:
overit.geocall.asserts.AssertsException- if lower bound value is greater equals than the upper bound ones.
-
anonymize
-