Newer
Older
sanitizer / README.md
@aljunggren aljunggren on 13 Sep 2020 1 KB Initial commit

Sanitizer

Annotate member variables for sanitation

public class User {
    @ConcurrentSpaceSanitation
    private String name;
}

Instantiate

Sanitizer sanitizer = new Sanitizer(object);

Sanitize

sanitizer.sanitize();

Concurrent Space Sanitation

Replaces all concurrent spaces with single space

@ConcurrentSpaceSanitation

Example:

User user = new User("John   Doe");
new Sanitizer(user).sanitize();
System.out.println(user.getName());

Output

John Doe

Data types supported

  • String

Lowercase Sanitation

Lowercase all characters

@LowercaseSanitation

Data types supported

  • String

Remove Sanitation

Removes all instances of given string

@RemoveSanitation(toRemove = "-")

Required

  • toRemove - [String]

Data types supported

  • String

Trim Sanitation

Remove leading and trailing spaces

@TrimSanitation

Data types supported

  • String

Uppercase Sanitation

Uppercase all characters

@UppercaseSanitation

Data types supported

  • String