public final class ExpressionUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.threeten.bp.format.DateTimeFormatter |
ISO_DATETIME_FORMAT |
protected static org.threeten.bp.format.DateTimeFormatter |
ISO_DATETIME_FORMAT_NO_SECOND_FRACTION |
protected static org.threeten.bp.format.DateTimeFormatter |
JSON_DATETIME_FORMAT |
| Modifier and Type | Method and Description |
|---|---|
static BigDecimal |
decimalPow(BigDecimal number,
BigDecimal power)
Pow for two decimals
|
static BigDecimal |
decimalRound(BigDecimal number,
int numDigits,
RoundingMode rounding)
Rounding for decimals with support for negative digits
|
static String |
formatIsoDate(org.threeten.bp.ZonedDateTime value)
Formats a date time as ISO8601 with microsecond precision and offset, e.g. "2014-10-03T09:41:12.790123+02:00"
|
static String |
formatJsonDate(org.threeten.bp.Instant value)
Formats a time instant as ISO8601 in UTC with millisecond precision, e.g. "2014-10-03T09:41:12.790Z"
|
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 org.threeten.bp.Instant |
parseJsonDate(String value)
Parses an ISO8601 formatted time instant from a string value
|
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 <T> Map<String,T> |
toLowerCaseKeys(Map<String,T> map)
Returns a copy of the given map with lowercase keys
|
static String |
urlquote(String text)
Encodes text for inclusion in a URL query string.
|
protected static org.threeten.bp.format.DateTimeFormatter ISO_DATETIME_FORMAT
protected static org.threeten.bp.format.DateTimeFormatter ISO_DATETIME_FORMAT_NO_SECOND_FRACTION
protected static org.threeten.bp.format.DateTimeFormatter JSON_DATETIME_FORMAT
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 BigDecimal decimalRound(BigDecimal number, int numDigits, RoundingMode rounding)
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 textpublic static String formatIsoDate(org.threeten.bp.ZonedDateTime value)
public static String formatJsonDate(org.threeten.bp.Instant value)
public static org.threeten.bp.Instant parseJsonDate(String value)
Copyright © 2018. All rights reserved.