Class UpperCaseSanitizer

java.lang.Object
io.github.rabinarayanpatra.sanitizer.builtin.UpperCaseSanitizer
All Implemented Interfaces:
FieldSanitizer<String>

public class UpperCaseSanitizer extends Object implements FieldSanitizer<String>
Sanitizer that converts the input string to uppercase using the default locale.

Useful for normalizing values like country codes, acronyms, or identifiers for consistent comparison or storage.

 
 String input = "abc123";
 String sanitized = new UpperCaseSanitizer().sanitize(input); // "ABC123"
 
 
Since:
1.0.0
See Also:
  • Constructor Details

    • UpperCaseSanitizer

      public UpperCaseSanitizer()
      Default constructor.
  • Method Details

    • sanitize

      public @Nullable String sanitize(@Nullable String in)
      Converts the input string to uppercase.
      Specified by:
      sanitize in interface FieldSanitizer<String>
      Parameters:
      in - the string to sanitize
      Returns:
      the uppercase version of the input, or null if input is null