Class JsonMaskingConfig.Builder
- Enclosing class:
- JsonMaskingConfig
JsonMaskingConfig instances using the builder pattern.-
Method Summary
Modifier and TypeMethodDescriptionallowJsonPaths(String... jsonPath) Only allow the given JSONPath to be unmasked, mask JSON values corresponding to any other key.allowJsonPaths(Set<String> jsonPaths) Only allow the given JSONPaths to be unmasked, mask JSON values corresponding to any other key.Only allow the given key to be unmasked, mask JSON values corresponding to any other key.Only allow the given keys to be unmasked, mask JSON values corresponding to any other key.build()Creates a newJsonMaskingConfiginstance.Configures whether the target keys are considered case-sensitive (e.g.maskBooleansWith(boolean value) Mask all boolean values with the provided value.maskBooleansWith(ValueMasker.BooleanMasker valueMasker) Mask all boolean values with the providedValueMasker.maskBooleansWith(String value) Mask all boolean values with the provided value.maskJsonPaths(String... jsonPaths) Masks all JSON values corresponding to the given JSONPaths with the default masking configuration.maskJsonPaths(String jsonPath, KeyMaskingConfig config) Masks all JSON values corresponding to the given JSONPath with the given masking configuration.maskJsonPaths(Map<String, KeyMaskingConfig> configs) Masks all JSON values corresponding to the given JSONPaths with the given masking configuration.maskJsonPaths(Set<String> jsonPaths) Masks all JSON values corresponding to the given JSONPaths with the default masking configuration.maskJsonPaths(Set<String> jsonPaths, KeyMaskingConfig config) Masks all JSON values corresponding to the given JSONPaths with the given masking configuration.Masks all JSON values corresponding to the given keys with the default masking configuration.maskKeys(String key, KeyMaskingConfig config) Masks all JSON values corresponding to the given key with the provided masking configuration.maskKeys(Map<String, KeyMaskingConfig> configs) Masks all JSON values corresponding to the given keys with the provided masking configuration.Masks all JSON values corresponding to the given keys with the default masking configuration.maskKeys(Set<String> keys, KeyMaskingConfig config) Masks all JSON values corresponding to the given keys with the provided masking configuration.maskNumberDigitsWith(int digit) Mask all digits of number values with the provided digit, preserving the length.maskNumbersWith(int value) Mask all number values with the provided value.maskNumbersWith(ValueMasker.NumberMasker valueMasker) Mask all numeric values with the providedValueMasker.maskNumbersWith(String value) Mask all number values with the provided value.maskStringCharactersWith(String value) Mask all characters of string values with the provided character, preserving the length.maskStringsWith(ValueMasker.StringMasker valueMasker) Mask all string values with the providedValueMasker.maskStringsWith(String value) Mask all string values with the provided value.
-
Method Details
-
maskKeys
Masks all JSON values corresponding to the given keys with the default masking configuration.- Returns:
- the builder instance
-
maskKeys
Masks all JSON values corresponding to the given keys with the default masking configuration.- Returns:
- the builder instance
-
maskKeys
Masks all JSON values corresponding to the given key with the provided masking configuration.- Returns:
- the builder instance
-
maskKeys
Masks all JSON values corresponding to the given keys with the provided masking configuration.- Returns:
- the builder instance
-
maskKeys
Masks all JSON values corresponding to the given keys with the provided masking configuration.- Returns:
- the builder instance
-
maskJsonPaths
Masks all JSON values corresponding to the given JSONPaths with the default masking configuration.- Returns:
- the builder instance
-
maskJsonPaths
Masks all JSON values corresponding to the given JSONPaths with the default masking configuration.- Returns:
- the builder instance
-
maskJsonPaths
Masks all JSON values corresponding to the given JSONPath with the given masking configuration.- Returns:
- the builder instance
-
maskJsonPaths
Masks all JSON values corresponding to the given JSONPaths with the given masking configuration.- Returns:
- the builder instance
-
maskJsonPaths
Masks all JSON values corresponding to the given JSONPaths with the given masking configuration.- Returns:
- the builder instance
-
allowKeys
Only allow the given key to be unmasked, mask JSON values corresponding to any other key.This method is incompatible with any mask method, except cases when a specific key(s) or JSONPath(s) needs to be masked with a specific
KeyMaskingConfigmasking configuration.- Returns:
- the builder instance
-
allowKeys
Only allow the given keys to be unmasked, mask JSON values corresponding to any other key.This method is incompatible with any mask method, except cases when a specific key(s) or JSONPath(s) needs to be masked with a specific
KeyMaskingConfigmasking configuration.- Returns:
- the builder instance
-
allowJsonPaths
Only allow the given JSONPath to be unmasked, mask JSON values corresponding to any other key.This method is incompatible with any mask method, except cases when a specific key(s) or JSONPath(s) needs to be masked with a specific
KeyMaskingConfigmasking configuration.- Returns:
- the builder instance
-
allowJsonPaths
Only allow the given JSONPaths to be unmasked, mask JSON values corresponding to any other key.This method is incompatible with any mask method, except cases when a specific key(s) or JSONPath(s) needs to be masked with a specific
KeyMaskingConfigmasking configuration.- 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
-
maskStringsWith
Mask all string values with the provided value. For example, "maskMe": "secret" -> "maskMe": "***".Masking strings with '***' is the default behaviour if no string masking option is set.
- Returns:
- the builder instance
- See Also:
-
maskStringCharactersWith
Mask all characters of string values with the provided character, preserving the length. For example, "maskMe": "secret" -> "maskMe": "******".- Returns:
- the builder instance
- See Also:
-
maskStringsWith
Mask all string values with the providedValueMasker.- Returns:
- the builder instance
- See Also:
-
maskNumbersWith
Mask all number values with the provided value. For example, "maskMe": 12345 -> "maskMe": "###".Masking numbers with '###' is the default behaviour if no number masking option is set.
- Returns:
- the builder instance
- See Also:
-
maskNumbersWith
Mask all number values with the provided value. For example, "maskMe": 12345 -> "maskMe": 0.- Returns:
- the builder instance
- See Also:
-
maskNumberDigitsWith
Mask all digits of number values with the provided digit, preserving the length. For example, "maskMe": 12345 -> "maskMe": 88888.- Returns:
- the builder instance
- See Also:
-
maskNumbersWith
Mask all numeric values with the providedValueMasker.- Returns:
- the builder instance
- See Also:
-
maskBooleansWith
Mask all boolean values with the provided value. For example, "maskMe": true -> "maskMe": "&&&".Masking booleans with '&&&' is the default behaviour if no boolean masking option is set.
- Returns:
- the builder instance
- See Also:
-
maskBooleansWith
Mask all boolean values with the provided value. For example, "maskMe": true -> "maskMe": false.- Returns:
- the builder instance
- See Also:
-
maskBooleansWith
Mask all boolean values with the providedValueMasker.- Returns:
- the builder instance
- See Also:
-
build
Creates a newJsonMaskingConfiginstance.- Returns:
- the new instance
-