public class Tools extends Object
Constructor and Description |
---|
Tools() |
Modifier and Type | Method and Description |
---|---|
static String |
chop(String source,
int length) |
static Map |
createSortedCaseInsensitiveMap()
Creates a TreeMap with a case-insenstive collator using the US Locale.
|
static String |
decodeURLString(String URLString) |
static String |
encodeURLString(String s) |
static String |
errorToString(Throwable e,
boolean stackTraceOnException) |
static String |
errorToString(Throwable e,
boolean stackTraceOnException,
int includeLines)
Takes an Exception object and formats a message that provides more debug information
suitable for developers for printing to System.out or for logging.
|
static String |
getStackTrace() |
static String |
getStackTrace(Throwable e) |
static String |
getStackTrace(Throwable e,
int includeLines) |
static String |
getStackTraceTop(Throwable t,
int lo,
int hi,
String delimiter) |
static String |
glue(String first,
String second)
useful for gluing URLs together, since this uses '/' as the glue character to call glue(String,String,String)
|
static String |
glue(String first,
String separator,
String second) |
static String |
implode(String[] strings,
String sep) |
static boolean |
isBlank(String str)
nulls, empty strings, and empty after trim() are considered blank.
|
static boolean |
isEmpty(String str)
Handles null strings as empty.
|
static boolean |
isTrue(String test)
Handles null strings as false.
|
static String |
join(String delim,
List<String> l) |
static String |
joinArray(String s,
Object... a) |
static void |
main(String[] args) |
static boolean |
notBlank(String str) |
static boolean |
notEmpty(String str)
Handles null strings as empty.
|
static Long |
now()
Milliseconds from start time as defined by the Date class.
|
static String |
nowLocale() |
static String |
searchAndReplace(String source,
String find,
String replace) |
static String |
searchAndReplaceWithQuoteReplacement(String source,
String find,
String replace) |
static String |
squeeze(String s)
Remove all whitespace from a String.
|
static void |
testStatic() |
public static String glue(String first, String second)
public static String glue(String first, String separator, String second)
public static Long now()
public static String nowLocale()
public static boolean isEmpty(String str)
public static boolean isBlank(String str)
public static boolean notEmpty(String str)
public static boolean notBlank(String str)
public static Map createSortedCaseInsensitiveMap()
public static boolean isTrue(String test)
public static String searchAndReplaceWithQuoteReplacement(String source, String find, String replace)
public static String getStackTrace()
public static String getStackTrace(Throwable e, int includeLines)
includeLines
- if zero, returns all linespublic static String getStackTraceTop(Throwable t, int lo, int hi, String delimiter)
public static String errorToString(Throwable e, boolean stackTraceOnException, int includeLines)
includeLines
- if zero, return all lines of stack trace, otherwise return number of lines from top.public static void testStatic()
Copyright © 2016. All rights reserved.