Package org.jumpmind.util
Class FormatUtils
java.lang.Object
org.jumpmind.util.FormatUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.commons.lang3.time.FastDateFormat
static final int
static final String
static final char
static final String
static final org.apache.commons.lang3.time.FastDateFormat
static final String[]
static final DateTimeFormatter
static final org.apache.commons.lang3.time.FastDateFormat
static final String[]
static final String[]
static final DateTimeFormatter
static final String
static final char
static final String
static final String
static final char
static final String
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
abbreviateForLogging
(String value) static String
abbreviateForLogging
(List list, int maxCharsToLog) Convert list of objects to abbreviated string for logging, making efficient use of memory for large listsstatic String
convertToPem
(X509Certificate cert) static String
escapeWildCards
(String str) static String
formatDateTimeISO
(Date date) static String
formatDurationReadable
(long duration) static String
formatString
(String format, String arg) static boolean
static boolean
static boolean
isMixedCase
(String text) static boolean
isWildCarded
(String str) static boolean
isWildCardMatch
(String text, String pattern) static boolean
isWildCardMatch
(String text, String pattern, boolean ignoreCase) static String
static Date
static Date
static Timestamp
static Timestamp
parseTimestampWithTimezone
(String str, String[] parsePatterns) static String
static String
static String
replaceToken
(String text, String tokenToReplace, String replaceWithText, boolean matchUsingPrefixSuffix) 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.static String[]
static String
stripTurkeyDottedI
(String str) static boolean
static String
unescapeWildCards
(String str) static String
static 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
-