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 RegexScrubberstatic RegexScrubberdateTimeFormat(String dateTimePattern) CreatesDateTimeScrubberto replace date/time strings of the given pattern localized by the defaultLocale.static RegexScrubberdateTimeFormat(String dateTimePattern, Locale locale) CreatesDateTimeScrubberto replace date/time strings of the given pattern localized by the given locale.static RegexScrubberisoDates()static RegexScrubberCreates aDateTimeScrubberfor 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 RegexScrubberisoDateTimes(Locale locale) Creates aDateTimeScrubberfor 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 RegexScrubberCreates aDateTimeScrubberfor ISO-8601 instants, like2019-02-25T12:34:56.123456789+02:00, or2019-02-25T12:34:56.123456789Z.static RegexScrubberCreates aDateTimeScrubberfor ISO-8601 local dates, like2019-02-25.static RegexScrubberCreates aDateTimeScrubberfor ISO-8601 local date/times, like12:34:56,12:34:56+02:00,12:34:56.123456789, or12:34:56.123456789+02:00.static RegexScrubberstatic RegexScrubberCreates aDateTimeScrubberfor ISO-8601 offset dates, like2019-02-25+02:00.static RegexScrubberCreates aDateTimeScrubberfor ISO-8601 offset date/times, like2019-02-25T12:34:56+02:00, or2019-02-25T12:34:56.123456789+02:00.static RegexScrubberCreates aDateTimeScrubberfor ISO-8601 offset times, like12:34:56+02:00, or12:34:56.123456789+02:00.static RegexScrubberstatic RegexScrubberisoTimes()Creates aDateTimeScrubberfor ISO-8601 times, like12:34:56,12:34:56+02:00,12:34:56.123456789, or12:34:56.123456789+02:00.static RegexScrubberstatic RegexScrubberCreates aDateTimeScrubberfor 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 RegexScrubberisoZonedDateTimes(Locale locale) Creates aDateTimeScrubberfor 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 RelativeDateScrubberrelativeDates(DateTimeFormatter dateFormatPattern) Creates aScrubberto replace date strings of the given pattern with relative descriptions, like[today],[yesterday],[2 days from now],[21 days ago].static RegexScrubberCreates aDateTimeScrubberfor RFC-1123 date/times, likeMon, 35 Feb 2019 12:34:56 GMT.static RegexScrubberstringsMatching(String pattern) Creates aRegexScrubberwith the given pattern.static RegexScrubberstringsMatching(Pattern pattern) Creates aRegexScrubberwith the given pattern.static RegexScrubberuuids()RegexScrubberfor UUIDs.
-
Method Details
-
stringsMatching
Creates aRegexScrubberwith the given pattern.- Parameters:
pattern- thePatternmatching the strings to be scrubbed- Returns:
- a
RegexScrubberwith the given pattern
-
stringsMatching
Creates aRegexScrubberwith the given pattern.- Parameters:
pattern- the pattern matching the string to be scrubbed asString- Returns:
- a
RegexScrubberwith the given pattern - See Also:
-
dateTimeFormat
CreatesDateTimeScrubberto replace date/time strings of the given pattern localized by the given locale.- Parameters:
dateTimePattern- a pattern as defined byDateTimeFormatterlocale- theLocaleto localize the date/time pattern (influences names of months or weekdays for example)- Returns:
- a
DateTimeScrubberfor the given date/time pattern - See Also:
-
dateTimeFormat
CreatesDateTimeScrubberto replace date/time strings of the given pattern localized by the defaultLocale.- Parameters:
dateTimePattern- a pattern as defined byDateTimeFormatter- Returns:
- a
DateTimeScrubberfor the given date/time pattern - See Also:
-
isoLocalDates
Creates aDateTimeScrubberfor ISO-8601 local dates, like2019-02-25.- Returns:
- a
DateTimeScrubberfor ISO-8601 local dates - See Also:
-
isoOffsetDates
Creates aDateTimeScrubberfor ISO-8601 offset dates, like2019-02-25+02:00.- Returns:
- a
DateTimeScrubberfor ISO-8601 offset dates - See Also:
-
isoDates
- Returns:
- a
DateTimeScrubberfor ISO-8601 dates - See Also:
-
isoLocalTimes
- Returns:
- a
DateTimeScrubberfor ISO-8601 local times - See Also:
-
isoOffsetTimes
Creates aDateTimeScrubberfor ISO-8601 offset times, like12:34:56+02:00, or12:34:56.123456789+02:00.- Returns:
- a
DateTimeScrubberfor ISO-8601 offset times - See Also:
-
isoTimes
Creates aDateTimeScrubberfor ISO-8601 times, like12:34:56,12:34:56+02:00,12:34:56.123456789, or12:34:56.123456789+02:00.- Returns:
- a
DateTimeScrubberfor ISO-8601 times - See Also:
-
isoLocalDateTimes
Creates aDateTimeScrubberfor 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
DateTimeScrubberfor ISO-8601 local date/times - See Also:
-
isoOffsetDateTimes
Creates aDateTimeScrubberfor ISO-8601 offset date/times, like2019-02-25T12:34:56+02:00, or2019-02-25T12:34:56.123456789+02:00.- Returns:
- a
DateTimeScrubberfor ISO-8601 offset date/times - See Also:
-
isoZonedDateTimes
Creates aDateTimeScrubberfor 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- theLocaleto localize the date/time pattern (influences names for zones codes)- Returns:
- a
DateTimeScrubberfor ISO-8601 zoned date/times - See Also:
-
isoZonedDateTimes
Creates aDateTimeScrubberfor 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
DateTimeScrubberfor ISO-8601 zoned date/times - See Also:
-
isoDateTimes
Creates aDateTimeScrubberfor 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].- Parameters:
locale- theLocaleto localize the date/time pattern (influences names for zones codes)- Returns:
- a
DateTimeScrubberfor ISO-8601 date/times - See Also:
-
isoDateTimes
Creates aDateTimeScrubberfor 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
DateTimeScrubberfor ISO-8601 date/times - See Also:
-
isoOrdinalDates
- Returns:
- a
DateTimeScrubberfor ISO-8601 ordinal dates - See Also:
-
isoWeekDates
- Returns:
- a
DateTimeScrubberfor ISO-8601 week dates - See Also:
-
isoInstants
Creates aDateTimeScrubberfor ISO-8601 instants, like2019-02-25T12:34:56.123456789+02:00, or2019-02-25T12:34:56.123456789Z.- Returns:
- a
DateTimeScrubberfor ISO-8601 instants - See Also:
-
basicIsoDates
- Returns:
- a
DateTimeScrubberfor basic ISO-8601 dates - See Also:
-
rfc1123DateTimes
Creates aDateTimeScrubberfor RFC-1123 date/times, likeMon, 35 Feb 2019 12:34:56 GMT. Note that this always uses theLocale.US.- Returns:
- a
DateTimeScrubberfor RFC-1123 date/times - See Also:
-
uuids
RegexScrubberfor UUIDs.- Returns:
- a
RegexScrubberthat replaces all UUIDs
-
relativeDates
Creates aScrubberto replace date strings of the given pattern with relative descriptions, like[today],[yesterday],[2 days from now],[21 days ago].- Parameters:
dateFormatPattern- aDateTimeFormatterto parse the dates- Returns:
- a new
RelativeDateScrubberwith the givenDateTimeFormatter.
-