@java.lang.SuppressWarnings("unused") public class StringUtilities extends java.lang.Object
These are utilities that should exist elsewhere, but I can't find a good simple library for them, and they are stupid but necessary for certain things.
Modifiers | Name | Description |
---|---|---|
static java.util.regex.Pattern |
elasticSearchChars |
|
static java.util.Set<java.lang.String> |
elasticSearchWords |
|
protected static org.slf4j.Logger |
logger |
|
static java.util.Map<java.lang.String, java.lang.String> |
xmlEntityMap |
Type Params | Return Type | Name and description |
---|---|---|
|
public static int |
calculateCrc16(java.lang.String input) |
|
public static java.lang.String |
camelCaseToPretty(java.lang.String camelCase) |
|
public static java.lang.String |
cleanStringForJavaName(java.lang.String original) |
|
public static java.lang.String |
decodeFromXml(java.lang.String original) |
|
public static java.lang.String |
elasticQueryAutoWildcard(java.lang.CharSequence query, boolean allFieldPrefix) |
|
public static java.lang.String |
elementValue(org.w3c.dom.Element element) |
|
public static java.lang.String |
encodeAsciiFilename(java.lang.String filename) |
|
public static java.lang.String |
encodeForXmlAttribute(java.lang.String original) |
|
public static java.lang.String |
encodeForXmlAttribute(java.lang.String original, boolean addZeroWidthSpaces) |
|
public static java.lang.String |
escapeElasticQueryString(java.lang.CharSequence queryString) |
|
public static java.lang.String |
findFirstNumber(java.lang.String orig) |
|
public static java.lang.String |
getExpressionClassName(java.lang.String expression) |
|
public static java.lang.String |
getRandomString(int length) |
|
public static java.lang.String |
getRandomString(int length, BaseNCodec baseNCodec) |
|
public static java.util.ArrayList<java.lang.String> |
getYearList(int years) |
|
public static boolean |
isAlphaNumeric(java.lang.String str, java.lang.String allowedChars) |
|
public static boolean |
isHexChar(char c) |
|
public static boolean |
isUrlDecoderSafe(java.lang.String text) See if contains only characters allowed by URLDecoder, if so doesn't need to be encoded or is already encoded |
|
public static boolean |
isUrlSafeRfc3986(java.lang.String text) |
|
public static javax.swing.text.MaskFormatter |
masker(java.lang.String mask, java.lang.String placeholder) |
|
public static java.lang.String |
numberToWords(long value, boolean useAnd) Convert any long input value to a text representation |
|
public static java.lang.String |
numberToWordsWithDecimal(java.math.BigDecimal value) |
|
public static java.lang.String |
paddedNumber(long number, java.lang.Integer desiredLength) |
|
public static java.lang.String |
paddedString(java.lang.String input, java.lang.Integer desiredLength, java.lang.Character padChar, boolean rightPad) |
|
public static java.lang.String |
paddedString(java.lang.String input, java.lang.Integer desiredLength, boolean rightPad) |
|
public static java.util.ArrayList<java.lang.String> |
pathStringToList(java.lang.String path, int skipSegments) |
|
public static java.lang.String |
prettyToCamelCase(java.lang.String pretty, boolean firstUpper) |
|
public static java.lang.String |
removeChar(java.lang.String orig, char ch) |
|
public static java.lang.String |
removeNonAlphaNumeric(java.lang.String origString) |
|
public static java.lang.String |
replaceNonAlphaNumeric(java.lang.String origString, char chr) |
|
public static java.lang.String |
toStringCleanBom(byte[] bytes) |
|
public static java.lang.String |
urlEncodeIfNeeded(java.lang.String text) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
See if contains only characters allowed by URLDecoder, if so doesn't need to be encoded or is already encoded
Convert any long input value to a text representation
value
- The value to convertuseAnd
- true if you want to use the word 'and' in the text (eleven thousand and thirteen)