@FunctionalInterface public interface ValueMasker
MaskingJsonGenerator before a number or string value is written
to determine if the value should be masked.
FieldMasker:FieldMaskers are more efficient than ValueMaskers, since FieldMaskers do not inspect values.FieldMaskers can mask any type of JSON field (string, number, boolean, array, object), whereas a ValueMasker can only mask string and number values.ValueMaskers can mask element values within an array. FieldMaskers can only mask field values.
| Modifier and Type | Method and Description |
|---|---|
Object |
mask(JsonStreamContext context,
Object value)
If the given value at the JSON stream context's current path should be masked,
then returns the masked value to write as the value..
|
Object mask(JsonStreamContext context, Object value)
MaskingJsonGenerator will write the returned masked value
as the value (instead of the original value).
If the given value at the JSON stream context's current path should NOT be masked, returns null.
context - the current JSON stream context, which can be used to determine the path within the JSON output.
(could be at a field value path or an array element value path)value - the number or string scalar value to potentially mask (could be a field value or an array element value).NullNode.instance.
To write , the return MaskingJsonGenerator.MASKCopyright © 2013–2021. All rights reserved.