Package dev.blaauwendraad.masker.json
Interface JsonMasker
- All Known Implementing Classes:
KeyContainsMasker
public interface JsonMasker
Masker that can be used to mask JSON objects and arrays.
-
Method Summary
Modifier and TypeMethodDescriptionstatic JsonMaskergetMasker(JsonMaskingConfig maskingConfig) Creates aJsonMaskerwith the providedJsonMaskingConfig.static JsonMaskerCreates a defaultJsonMaskerwith the provided target key.static JsonMaskerCreates a defaultJsonMaskerwith the provided target key(s).byte[]mask(byte[] input) Masks the given JSON input and returns the masked output.default StringMasks the given JSON input and returns the masked output.
-
Method Details
-
getMasker
Creates a defaultJsonMaskerwith the provided target key.- Parameters:
targetKey- the key to target- Returns:
- the
JsonMaskerinstance
-
getMasker
Creates a defaultJsonMaskerwith the provided target key(s).- Parameters:
targetKeys- the key(s) to target- Returns:
- the
JsonMaskerinstance
-
getMasker
Creates aJsonMaskerwith the providedJsonMaskingConfig.- Parameters:
maskingConfig- the JSON masker configuration- Returns:
- a new
JsonMaskerinstance corresponding to the providedJsonMaskingConfig
-
mask
byte[] mask(byte[] input) Masks the given JSON input and returns the masked output.- Parameters:
input- the JSON input as bytes- Returns:
- the masked JSON output as bytes
-
mask
Masks the given JSON input and returns the masked output.- Parameters:
input- the JSON input as String- Returns:
- the masked JSON output String
-