public class ExpressionUtils extends Object
| Constructor and Description |
|---|
ExpressionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static BigDecimal |
decimalPow(BigDecimal number,
BigDecimal power)
Pow for two decimals
|
static org.threeten.bp.format.DateTimeFormatter |
getDateFormatter(DateStyle dateStyle,
boolean incTime)
Gets a formatter for dates or datetimes
|
static <K,V> V |
getOrDefault(Map<K,V> map,
K key,
V defaultValue)
Replacement for Java 8's Map#getOrDefault(String, Object)
|
static <T> List<T> |
slice(List<T> list,
Integer start,
Integer stop)
Slices a list, Python style
|
static String[] |
tokenize(String text)
Tokenizes a string by splitting on non-word characters.
|
static String |
urlquote(String text)
Encodes text for inclusion in a URL query string.
|
public static <T> List<T> slice(List<T> list, Integer start, Integer stop)
list - the liststart - the start index (null means the beginning of the list)stop - the stop index (null means the end of the list)public static BigDecimal decimalPow(BigDecimal number, BigDecimal power)
public static String urlquote(String text)
text - the text to encodepublic static org.threeten.bp.format.DateTimeFormatter getDateFormatter(DateStyle dateStyle, boolean incTime)
dateStyle - whether parsing should be day-first or month-firstincTime - whether to include timepublic static <K,V> V getOrDefault(Map<K,V> map, K key, V defaultValue)
public static String[] tokenize(String text)
text - the input textCopyright © 2015. All rights reserved.