Package org.jumpmind.util
Class FormatUtils
java.lang.Object
org.jumpmind.util.FormatUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.commons.lang3.time.FastDateFormatstatic final intstatic final Stringstatic final charstatic final Stringstatic final org.apache.commons.lang3.time.FastDateFormatstatic final String[]static final DateTimeFormatterstatic final org.apache.commons.lang3.time.FastDateFormatstatic final String[]static final String[]static final DateTimeFormatterstatic final Stringstatic final charstatic final Stringstatic final Stringstatic final charstatic final String -
Method Summary
Modifier and TypeMethodDescriptionstatic StringabbreviateForLogging(String value) static StringabbreviateForLogging(List list, int maxCharsToLog) Convert list of objects to abbreviated string for logging, making efficient use of memory for large listsstatic StringconvertToPem(X509Certificate cert) static StringescapeWildCards(String str) static StringformatDateTimeISO(Date date) static StringformatDurationReadable(long duration) static StringformatString(String format, String arg) static booleanstatic booleanstatic booleanisMixedCase(String text) static booleanisWildCarded(String str) static booleanisWildCardMatch(String text, String pattern) static booleanisWildCardMatch(String text, String pattern, boolean ignoreCase) static Stringstatic Datestatic Datestatic Timestampstatic TimestampparseTimestampWithTimezone(String str, String[] parsePatterns) static Stringstatic Stringstatic StringreplaceToken(String text, String tokenToReplace, String replaceWithText, boolean matchUsingPrefixSuffix) static StringreplaceTokens(String text, Map<String, String> replacements, boolean matchUsingPrefixSuffix) Replace the keys found in the target text with the values found in the replacements map.static String[]static StringstripTurkeyDottedI(String str) static booleanstatic StringunescapeWildCards(String str) static Stringstatic String[]static String[]Word wrap a string where the line size for the first line is different than the lines sizes for the other lines.
-
Field Details
-
TIMESTAMP_PATTERNS
-
TIME_PATTERNS
-
TIMESTAMP_WITH_TIMEZONE_PATTERNS
-
TIMESTAMP_FORMATTER
public static final org.apache.commons.lang3.time.FastDateFormat TIMESTAMP_FORMATTER -
DATE_FORMATTER
public static final org.apache.commons.lang3.time.FastDateFormat DATE_FORMATTER -
TIMESTAMP9_FORMATTER
-
TIME_FORMATTER
public static final org.apache.commons.lang3.time.FastDateFormat TIME_FORMATTER -
TIME9_FORMATTER
-
WILDCARD
- See Also:
-
WILDCARD_SEPARATOR
- See Also:
-
NEGATE_TOKEN
- See Also:
-
WILDCARD_SEPARATOR_CHAR
public static final char WILDCARD_SEPARATOR_CHAR -
WILDCARD_CHAR
public static final char WILDCARD_CHAR -
NEGATE_TOKEN_CHAR
public static final char NEGATE_TOKEN_CHAR -
WILDCARD_ESCAPED
- See Also:
-
WILDCARD_SEPARATOR_ESCAPED
- See Also:
-
NEGATE_TOKEN_ESCAPED
- See Also:
-
MAX_CHARS_TO_LOG
public static final int MAX_CHARS_TO_LOG- See Also:
-
-
Method Details
-
replace
-
replaceToken
-
replaceTokens
public static String replaceTokens(String text, Map<String, String> replacements, boolean matchUsingPrefixSuffix) Replace the keys found in the target text with the values found in the replacements map.- Parameters:
text- The text to replacereplacements- The map that contains the replacement valuesmatchUsingPrefixSuffix- If true, look for the $(key) pattern to replace. If false, just replace the key outright.- Returns:
- The text with the token keys replaced
-
formatString
-
toBoolean
-
isMixedCase
-
isWildCardMatch
-
isWildCardMatch
-
unescapeWildCards
-
escapeWildCards
-
isWildCarded
-
wordWrap
Word wrap a string where the line size for the first line is different than the lines sizes for the other lines.- Parameters:
str-firstLineSize-nonFirstLineSize-- Returns:
-
wordWrap
-
abbreviateForLogging
-
abbreviateForLogging
Convert list of objects to abbreviated string for logging, making efficient use of memory for large lists -
parseDate
-
parseDate
-
parseTimestampWithTimezone
-
parseTimestampWithTimezone
-
splitOnSpacePreserveQuotedStrings
-
replaceCharsToShortenName
-
lower
-
upper
-
isInfamousTurkey
public static boolean isInfamousTurkey() -
stripTurkeyDottedI
-
formatDurationReadable
-
formatDateTimeISO
-
isInteger
-
convertToPem
- Throws:
CertificateEncodingException
-