Package dev.blaauwendraad.masker.json
Interface ValueMasker
- All Known Subinterfaces:
ValueMasker.AnyValueMasker,ValueMasker.BooleanMasker,ValueMasker.NumberMasker,ValueMasker.StringMasker
public sealed interface ValueMasker
permits ValueMasker.StringMasker, ValueMasker.NumberMasker, ValueMasker.BooleanMasker, ValueMasker.AnyValueMasker
A functional interface which enables masking JSON values (boolean, numbers, and strings) in almost every imaginable
way. Accepts
ValueMaskerContext that contains the context of the current value being masked.
This is a sealed interface in order to make sure that correct JSON type is only masked with the implementation
that supports masking of that particular type of the value. There's also a special ValueMasker.AnyValueMasker
that can mask values of any JSON type.
Most of the out-of-the-box implementation are, in fact, instances of ValueMasker.AnyValueMasker, but
some concrete implementations can only mask values of the specific type: For strings it's
ValueMaskers.email(int, int, boolean, String) and ValueMaskers.eachCharacterWith(String), for numbers
ValueMaskers.eachDigitWith(int).
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceValueMaskerthat can mask any JSON value (string, number or a boolean).static interfaceValueMaskerthat can mask JSON boolean values.static interfaceValueMaskerthat can mask JSON number values.static interfaceValueMaskerthat can mask JSON string values. -
Method Summary
Modifier and TypeMethodDescriptionvoidmaskValue(ValueMaskerContext context) Used for masking JSON values.
-
Method Details
-
maskValue
Used for masking JSON values. AcceptsValueMaskerContextthat contains context of the current value being masked.
-