Class JsonMaskingConfig
java.lang.Object
dev.blaauwendraad.masker.json.config.JsonMaskingConfig
Contains the JSON masker configurations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder to createJsonMaskingConfig
instances using the builder pattern.static enum
Defines how target keys should be interpreted. -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonMaskingConfig.Builder
builder()
Creates a newJsonMaskingConfig
builder instance forJsonMaskingConfig
.boolean
Tests if target keys should be considered case-sensitive.Returns the config for the given key.Returns a map with all masking configs per key.boolean
Checks if the target key mode is set to "ALLOW".boolean
Checks if the target key mode is set to "MASK".toString()
-
Method Details
-
builder
Creates a newJsonMaskingConfig
builder instance forJsonMaskingConfig
.- Returns:
- the
JsonMaskingConfig
builder instance
-
isInAllowMode
public boolean isInAllowMode()Checks if the target key mode is set to "ALLOW". If the mode is set to "ALLOW", it means that the target keys are interpreted as the only JSON keys for which the corresponding property is allowed (should not be masked).- Returns:
- true if the target key mode is set to "ALLOW", false otherwise
-
isInMaskMode
public boolean isInMaskMode()Checks if the target key mode is set to "MASK". If the mode is set to "MASK", it means that the properties corresponding to the target keys should be masked.- Returns:
- true if the current target key mode is in "MASK" mode, false otherwise
-
getTargetKeys
-
getTargetJsonPaths
-
caseSensitiveTargetKeys
public boolean caseSensitiveTargetKeys()Tests if target keys should be considered case-sensitive.- Returns:
- true if target keys are considered case-sensitive and false otherwise.
-
getConfig
Returns the config for the given key. If no specific config is available for the given key, the default config.- Parameters:
key
- key to be masked- Returns:
- the config for the given key
-
getDefaultConfig
-
getKeyConfigs
Returns a map with all masking configs per key.- Returns:
- masking configs per key
-
toString
-