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
static 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 RegexScrubber
isoDates()
static RegexScrubber
Creates aDateTimeScrubber
for ISO-8601 date/times, like2019-02-25T12:34:56
,2019-02-25T12:34:56.123456789
,2019-02-25T12:34:56+02:00
, or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin]
.static RegexScrubber
isoDateTimes
(Locale locale) Creates aDateTimeScrubber
for ISO-8601 date/times, like2019-02-25T12:34:56
,2019-02-25T12:34:56.123456789
,2019-02-25T12:34:56+02:00
, or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin]
.static RegexScrubber
Creates aDateTimeScrubber
for ISO-8601 instants, like2019-02-25T12:34:56.123456789+02:00
, or2019-02-25T12:34:56.123456789Z
.static RegexScrubber
Creates aDateTimeScrubber
for ISO-8601 local dates, like2019-02-25
.static RegexScrubber
Creates aDateTimeScrubber
for ISO-8601 local date/times, like12:34:56
,12:34:56+02:00
,12:34:56.123456789
, or12:34:56.123456789+02:00
.static RegexScrubber
static RegexScrubber
Creates aDateTimeScrubber
for ISO-8601 offset dates, like2019-02-25+02:00
.static RegexScrubber
Creates aDateTimeScrubber
for ISO-8601 offset date/times, like2019-02-25T12:34:56+02:00
, or2019-02-25T12:34:56.123456789+02:00
.static RegexScrubber
Creates aDateTimeScrubber
for ISO-8601 offset times, like12:34:56+02:00
, or12:34:56.123456789+02:00
.static RegexScrubber
static RegexScrubber
isoTimes()
Creates aDateTimeScrubber
for ISO-8601 times, like12:34:56
,12:34:56+02:00
,12:34:56.123456789
, or12:34:56.123456789+02:00
.static RegexScrubber
static RegexScrubber
Creates aDateTimeScrubber
for ISO-8601 zoned date/times, like2019-02-25T12:34:56+02:00
,2019-02-25T12:34:56.123456789+02:00
,2019-02-25T12:34:56+02:00[Europe/Berlin]
, or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin]
.static RegexScrubber
isoZonedDateTimes
(Locale locale) Creates aDateTimeScrubber
for ISO-8601 zoned date/times, like2019-02-25T12:34:56+02:00
,2019-02-25T12:34:56.123456789+02:00
,2019-02-25T12:34:56+02:00[Europe/Berlin]
, or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin]
.static RelativeDateScrubber
relativeDates
(DateTimeFormatter dateFormatPattern) Creates aScrubber
to replace date strings of the given pattern.static RegexScrubber
Creates aDateTimeScrubber
for RFC-1123 date/times, likeMon, 35 Feb 2019 12:34:56 GMT
.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:
-
isoLocalDates
Creates aDateTimeScrubber
for ISO-8601 local dates, like2019-02-25
.- Returns:
- a
DateTimeScrubber
for ISO-8601 local dates - See Also:
-
isoOffsetDates
Creates aDateTimeScrubber
for ISO-8601 offset dates, like2019-02-25+02:00
.- Returns:
- a
DateTimeScrubber
for ISO-8601 offset dates - See Also:
-
isoDates
- Returns:
- a
DateTimeScrubber
for ISO-8601 dates - See Also:
-
isoLocalTimes
- Returns:
- a
DateTimeScrubber
for ISO-8601 local times - See Also:
-
isoOffsetTimes
Creates aDateTimeScrubber
for ISO-8601 offset times, like12:34:56+02:00
, or12:34:56.123456789+02:00
.- Returns:
- a
DateTimeScrubber
for ISO-8601 offset times - See Also:
-
isoTimes
Creates aDateTimeScrubber
for ISO-8601 times, like12:34:56
,12:34:56+02:00
,12:34:56.123456789
, or12:34:56.123456789+02:00
.- Returns:
- a
DateTimeScrubber
for ISO-8601 times - See Also:
-
isoLocalDateTimes
Creates aDateTimeScrubber
for ISO-8601 local date/times, like12:34:56
,12:34:56+02:00
,12:34:56.123456789
, or12:34:56.123456789+02:00
.- Returns:
- a
DateTimeScrubber
for ISO-8601 local date/times - See Also:
-
isoOffsetDateTimes
Creates aDateTimeScrubber
for ISO-8601 offset date/times, like2019-02-25T12:34:56+02:00
, or2019-02-25T12:34:56.123456789+02:00
.- Returns:
- a
DateTimeScrubber
for ISO-8601 offset date/times - See Also:
-
isoZonedDateTimes
Creates aDateTimeScrubber
for ISO-8601 zoned date/times, like2019-02-25T12:34:56+02:00
,2019-02-25T12:34:56.123456789+02:00
,2019-02-25T12:34:56+02:00[Europe/Berlin]
, or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin]
.- Parameters:
locale
- theLocale
to localize the date/time pattern (influences names for zones codes)- Returns:
- a
DateTimeScrubber
for ISO-8601 zoned date/times - See Also:
-
isoZonedDateTimes
Creates aDateTimeScrubber
for ISO-8601 zoned date/times, like2019-02-25T12:34:56+02:00
,2019-02-25T12:34:56.123456789+02:00
,2019-02-25T12:34:56+02:00[Europe/Berlin]
, or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin]
.- Returns:
- a
DateTimeScrubber
for ISO-8601 zoned date/times - See Also:
-
isoDateTimes
Creates aDateTimeScrubber
for ISO-8601 date/times, like2019-02-25T12:34:56
,2019-02-25T12:34:56.123456789
,2019-02-25T12:34:56+02:00
, or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin]
.- Returns:
- a
DateTimeScrubber
for ISO-8601 date/times - See Also:
-
isoDateTimes
Creates aDateTimeScrubber
for ISO-8601 date/times, like2019-02-25T12:34:56
,2019-02-25T12:34:56.123456789
,2019-02-25T12:34:56+02:00
, or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin]
.- Returns:
- a
DateTimeScrubber
for ISO-8601 date/times - See Also:
-
isoOrdinalDates
- Returns:
- a
DateTimeScrubber
for ISO-8601 ordinal dates - See Also:
-
isoWeekDates
- Returns:
- a
DateTimeScrubber
for ISO-8601 week dates - See Also:
-
isoInstants
Creates aDateTimeScrubber
for ISO-8601 instants, like2019-02-25T12:34:56.123456789+02:00
, or2019-02-25T12:34:56.123456789Z
.- Returns:
- a
DateTimeScrubber
for ISO-8601 instants - See Also:
-
basicIsoDates
- Returns:
- a
DateTimeScrubber
for basic ISO-8601 dates - See Also:
-
rfc1123DateTimes
Creates aDateTimeScrubber
for RFC-1123 date/times, likeMon, 35 Feb 2019 12:34:56 GMT
. Note that this always uses theLocale.US
.- Returns:
- a
DateTimeScrubber
for RFC-1123 date/times - 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
.
-