Class StringAnonymizer
- java.lang.Object
-
- org.apache.directory.api.ldap.model.ldif.anonymizer.AbstractAnonymizer<String>
-
- org.apache.directory.api.ldap.model.ldif.anonymizer.StringAnonymizer
-
- All Implemented Interfaces:
Anonymizer<String>
public class StringAnonymizer extends AbstractAnonymizer<String>
A default anonymizer for attributes that are HR. It covers DirectoryString, Ia5String, ...- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description StringAnonymizer()
Creates a new instance of StringAnonymizer.StringAnonymizer(Map<Integer,String> latestStringMap)
Creates a new instance of StringAnonymizer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Attribute
anonymize(Map<Value,Value> valueMap, Set<Value> valueSet, Attribute attribute)
Anonymize an attribute using pure random values (either chars of bytes, depending on the Attribute type)Map<Integer,String>
getLatestStringMap()
void
setLatestStringMap(Map<Integer,String> latestStringMap)
-
Methods inherited from class org.apache.directory.api.ldap.model.ldif.anonymizer.AbstractAnonymizer
getLatestBytesMap, setAnonymizers, setLatestBytesMap, setSchemaManager
-
-
-
-
Constructor Detail
-
StringAnonymizer
public StringAnonymizer()
Creates a new instance of StringAnonymizer.
-
StringAnonymizer
public StringAnonymizer(Map<Integer,String> latestStringMap)
Creates a new instance of StringAnonymizer.- Parameters:
latestStringMap
- The map containing the latest value for each length
-
-
Method Detail
-
anonymize
public Attribute anonymize(Map<Value,Value> valueMap, Set<Value> valueSet, Attribute attribute)
Anonymize an attribute using pure random values (either chars of bytes, depending on the Attribute type)- Parameters:
valueMap
- The existing map of value to the associated anonymized counterpartvalueSet
- The existing set of anonymized counterpartattribute
- The attribute to anonymize- Returns:
- The anonymized attribute
-
getLatestStringMap
public Map<Integer,String> getLatestStringMap()
- Specified by:
getLatestStringMap
in interfaceAnonymizer<String>
- Overrides:
getLatestStringMap
in classAbstractAnonymizer<String>
- Returns:
- The latest String anonymized value map
-
setLatestStringMap
public void setLatestStringMap(Map<Integer,String> latestStringMap)
- Specified by:
setLatestStringMap
in interfaceAnonymizer<String>
- Overrides:
setLatestStringMap
in classAbstractAnonymizer<String>
- Parameters:
latestStringMap
- The latest String anonymized value map
-
-