Class JsonMaskingConfig.Builder
java.lang.Object
dev.blaauwendraad.masker.json.config.JsonMaskingConfig.Builder
- Enclosing class:
- JsonMaskingConfig
Builder to create
JsonMaskingConfig
instances using the builder pattern.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates a newJsonMaskingConfig
instance.Configures whether the target keys are considered case-sensitive (e.g.maskNumericValuesWith
(int maskNumericValuesWith) Specifies the number with which numeric values should be replaced.obfuscationLength
(int obfuscationLength)
-
Constructor Details
-
Builder
-
-
Method Details
-
maskNumericValuesWith
Specifies the number with which numeric values should be replaced. -1 denotes number masking is disabled.In case maskNumericValuesWith is set to 0, obfuscationLength must be set to either 0 or 1 in which both case numbers are replaced with a single 0. This is in order to preserve valid JSON.
Default value: -1 (numeric values are not masked)
- Parameters:
maskNumericValuesWith
- the number to mask numeric JSON properties with- Returns:
- the builder instance
-
obfuscationLength
- Parameters:
obfuscationLength
- specifies the fixed length of the mask when target value lengths is obfuscated. E.g. masking any string value with obfuscation length 2 results in "**".In case obfuscationLength is set to 0 and number masking is enabled, it must be 0 (i.e. each numeric value is replaced with a single 0 because JSON does not support empty values).
Default value: -1 (length obfuscation disabled).
- Returns:
- the builder instance
-
caseSensitiveTargetKeys
Configures whether the target keys are considered case-sensitive (e.g. cvv != CVV)Default value: false (target keys are considered case-insensitive)
- Returns:
- the builder instance
-
build
Creates a newJsonMaskingConfig
instance.- Returns:
- the new instance
-