Package com.linkedin.alpini.base.misc
Enum DateUtils
- java.lang.Object
-
- java.lang.Enum<DateUtils>
-
- com.linkedin.alpini.base.misc.DateUtils
-
-
Enum Constant Summary
Enum Constants Enum Constant Description SINGLETON
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringASCTIME_DATE_FORMATstatic java.lang.StringRFC1036_DATE_FORMATstatic java.lang.StringRFC1123_DATE_FORMAT
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String[]escapedSplit(java.lang.String escape, java.lang.String split, java.lang.String target)Splits a target string according to some substring (non-regex), which may be escaped in the target string.static java.lang.StringgetAnsiCDate(long timeMillis)static java.lang.StringgetAnsiCDate(java.util.Date date)static java.lang.StringgetRFC1036Date(long timeMillis)static java.lang.StringgetRFC1036Date(java.util.Date date)static java.lang.StringgetRFC1123Date(long timeMillis)static java.lang.StringgetRFC1123Date(java.util.Date date)static java.util.DateparseDate(java.lang.String dateValue)static java.util.DateparseRFC1123Date(java.lang.String dateValue)static DateUtilsvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static DateUtils[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SINGLETON
public static final DateUtils SINGLETON
-
-
Field Detail
-
RFC1123_DATE_FORMAT
public static final java.lang.String RFC1123_DATE_FORMAT
- See Also:
- Constant Field Values
-
RFC1036_DATE_FORMAT
public static final java.lang.String RFC1036_DATE_FORMAT
- See Also:
- Constant Field Values
-
ASCTIME_DATE_FORMAT
public static final java.lang.String ASCTIME_DATE_FORMAT
- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static DateUtils[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DateUtils c : DateUtils.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DateUtils valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getRFC1123Date
@Nonnull public static java.lang.String getRFC1123Date(long timeMillis)
-
getRFC1123Date
@Nonnull public static java.lang.String getRFC1123Date(@Nonnull java.util.Date date)
-
getRFC1036Date
@Nonnull public static java.lang.String getRFC1036Date(long timeMillis)
-
getRFC1036Date
@Nonnull public static java.lang.String getRFC1036Date(@Nonnull java.util.Date date)
-
getAnsiCDate
@Nonnull public static java.lang.String getAnsiCDate(long timeMillis)
-
getAnsiCDate
@Nonnull public static java.lang.String getAnsiCDate(@Nonnull java.util.Date date)
-
parseRFC1123Date
public static java.util.Date parseRFC1123Date(@Nonnull java.lang.String dateValue)
-
parseDate
public static java.util.Date parseDate(@Nonnull java.lang.String dateValue)
-
escapedSplit
public static java.lang.String[] escapedSplit(java.lang.String escape, java.lang.String split, java.lang.String target)Splits a target string according to some substring (non-regex), which may be escaped in the target string. E.g. escapedSplit("\\", ":", "urn\\:li\\:test:val") returns ["urn\\:li\\:test", "val"]- Parameters:
escape- The escape sequence (if present in target, it must itself also be escaped)split- The substring on which to tokenize.target- The string to split- Returns:
- An array of tokens, split on a substring
-
-