Enum Class JsonMaskerAlgorithmType

java.lang.Object
java.lang.Enum<JsonMaskerAlgorithmType>
dev.blaauwendraad.masker.json.config.JsonMaskerAlgorithmType
All Implemented Interfaces:
Serializable, Comparable<JsonMaskerAlgorithmType>, Constable

public enum JsonMaskerAlgorithmType extends Enum<JsonMaskerAlgorithmType>
Specifies the multi target key masking algorithm used to mask the values of multiple target keys.

SINGLE_TARGET_LOOP loops over the target key set and executes the single-target key masking algorithm for each key. (time complexity cN * K, where N is the message input size, K the target key set size, and c is some constant) KEYS_CONTAIN uses a dedicated multi-target algorithm by looking for a JSON key and checking whether the target key set contains this key. (time complexity cN, where N is the message input size and c is some constant) Note: for small target key set (1-2 entries), the SINGLE_TARGET_LOOP might actually be faster for multi-target masking since the constant is slightly smaller.

The main reason this library contains both algorithm is to support automated fuzzing testing (randomly generating a huge number input messages and verifying that both algorithms result in an equal output to catch bugs).

Default value: KEYS_CONTAIN

  • Enum Constant Details

  • Method Details

    • values

      public static JsonMaskerAlgorithmType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static JsonMaskerAlgorithmType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null