Package org.approvej.scrub
Class Scrubbers
java.lang.Object
org.approvej.scrub.Scrubbers
Collection of static methods to create
Scrubber
instances.-
Method Summary
Modifier and TypeMethodDescriptionstatic RegexScrubber
dateTimeFormat
(String dateTimePattern) CreatesDateTimeScrubber
to replace date/time strings of the given pattern localized by the defaultLocale
.static RegexScrubber
dateTimeFormat
(String dateTimePattern, Locale locale) CreatesDateTimeScrubber
to replace date/time strings of the given pattern localized by the given locale.static RelativeDateScrubber
relativeDates
(DateTimeFormatter dateFormatPattern) Creates aScrubber
to replace date strings of the given pattern.static RegexScrubber
stringsMatching
(String pattern) Creates aRegexScrubber
with the given pattern.static RegexScrubber
stringsMatching
(Pattern pattern) Creates aRegexScrubber
with the given pattern.static RegexScrubber
uuids()
RegexScrubber
for UUIDs.
-
Method Details
-
stringsMatching
Creates aRegexScrubber
with the given pattern.- Parameters:
pattern
- thePattern
matching the strings to be scrubbed- Returns:
- a
RegexScrubber
with the given pattern
-
stringsMatching
Creates aRegexScrubber
with the given pattern.- Parameters:
pattern
- the pattern matching the string to be scrubbed asString
- Returns:
- a
RegexScrubber
with the given pattern - See Also:
-
dateTimeFormat
CreatesDateTimeScrubber
to replace date/time strings of the given pattern localized by the given locale.- Parameters:
dateTimePattern
- a pattern as defined byDateTimeFormatter
locale
- theLocale
to localize the date/time pattern (influences names of months or weekdays for example)- Returns:
- a
DateTimeScrubber
for the given date/time pattern - See Also:
-
dateTimeFormat
CreatesDateTimeScrubber
to replace date/time strings of the given pattern localized by the defaultLocale
.- Parameters:
dateTimePattern
- a pattern as defined byDateTimeFormatter
- Returns:
- a
DateTimeScrubber
for the given date/time pattern - See Also:
-
uuids
RegexScrubber
for UUIDs.- Returns:
- a
RegexScrubber
that replaces all UUIDs
-
relativeDates
Creates aScrubber
to replace date strings of the given pattern.- Parameters:
dateFormatPattern
- aDateTimeFormatter
to parse the dates- Returns:
- a new
RelativeDateScrubber
with the givenDateTimeFormatter
.
-