Class KeyMaskingConfig.Builder
java.lang.Object
dev.blaauwendraad.masker.json.config.KeyMaskingConfig.Builder
- Enclosing class:
- KeyMaskingConfig
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds theKeyMaskingConfig
instance.Disables boolean masking.Disables number masking.maskBooleansWith
(boolean value) Mask all boolean values with the provided value.maskBooleansWith
(String value) Mask all boolean values with the provided value.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
(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
(String value) Mask all string values with the provided value.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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:
-
disableNumberMasking
Disables number masking.- 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:
-
disableBooleanMasking
Disables boolean masking.- 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:
-
build
Builds theKeyMaskingConfig
instance.- Returns:
- the
KeyMaskingConfig
instance
-