Class IBANMaskSanitizer
java.lang.Object
io.github.rabinarayanpatra.sanitizer.builtin.IBANMaskSanitizer
- All Implemented Interfaces:
FieldSanitizer<String>
Sanitizer that masks an International Bank Account Number (IBAN), preserving
only the last four characters.
All whitespace is removed before masking. The result is a masked string of asterisks followed by the last four characters of the IBAN, helping protect sensitive account details while retaining partial traceability.
String input = "DE89 3704 0044 0532 0130 00";
String masked = new IBANMaskSanitizer().sanitize(input);
// "********************3000"
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
IBANMaskSanitizer
public IBANMaskSanitizer()Default constructor.
-
-
Method Details
-
sanitize
Masks all but the last four characters of an IBAN, removing whitespace before processing.- Specified by:
sanitizein interfaceFieldSanitizer<String>- Parameters:
in- the IBAN string to sanitize- Returns:
- the masked IBAN, or the original input if it has four or fewer
characters;
nullif input is null
-