Class JsonMaskingConfig

java.lang.Object
dev.blaauwendraad.masker.json.config.JsonMaskingConfig

public final class JsonMaskingConfig extends Object
Contains the JSON masker configurations.
  • Method Details

    • builder

      public static JsonMaskingConfig.Builder builder()
      Creates a new JsonMaskingConfig builder instance for JsonMaskingConfig.
      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

      public Set<String> getTargetKeys()
    • getTargetJsonPaths

      public Set<JsonPath> 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

      public KeyMaskingConfig getConfig(String key)
      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

      public KeyMaskingConfig getDefaultConfig()
    • getKeyConfigs

      public Map<String,KeyMaskingConfig> getKeyConfigs()
      Returns a map with all masking configs per key.
      Returns:
      masking configs per key
    • toString

      public String toString()
      Overrides:
      toString in class Object