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 JsonMasker
getMasker
(JsonMaskingConfig maskingConfig) Creates aJsonMasker
with the providedJsonMaskingConfig
.static JsonMasker
Creates a defaultJsonMasker
with the provided target key.static JsonMasker
Creates a defaultJsonMasker
with the provided target key(s).byte[]
mask
(byte[] input) Masks the given JSON input and returns the masked output.default String
Masks the given JSON input and returns the masked output.
-
Method Details
-
getMasker
Creates a defaultJsonMasker
with the provided target key.- Parameters:
targetKey
- the key to target- Returns:
- the
JsonMasker
instance
-
getMasker
Creates a defaultJsonMasker
with the provided target key(s).- Parameters:
targetKeys
- the key(s) to target- Returns:
- the
JsonMasker
instance
-
getMasker
Creates aJsonMasker
with the providedJsonMaskingConfig
.- Parameters:
maskingConfig
- the JSON masker configuration- Returns:
- a new
JsonMasker
instance 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
-