Class JsonMaskingConfig
java.lang.Object
dev.blaauwendraad.masker.json.config.JsonMaskingConfig
Contains the JSON masker configurations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder to createJsonMaskingConfiginstances using the builder pattern.static enumDefines how target keys should be interpreted. -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonMaskingConfig.Builderbuilder()Creates a newJsonMaskingConfigbuilder instance forJsonMaskingConfig.booleanTests if target keys should be considered case-sensitive.Returns the config for the given key.Returns a map with all masking configs per key.booleanChecks if the target key mode is set to "ALLOW".booleanChecks if the target key mode is set to "MASK".toString()
-
Method Details
-
builder
Creates a newJsonMaskingConfigbuilder instance forJsonMaskingConfig.- Returns:
- the
JsonMaskingConfigbuilder 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
-