Enum DateUtils

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DateUtils>

    public enum DateUtils
    extends java.lang.Enum<DateUtils>
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      SINGLETON  
    • 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.String getAnsiCDate​(long timeMillis)  
      static java.lang.String getAnsiCDate​(java.util.Date date)  
      static java.lang.String getRFC1036Date​(long timeMillis)  
      static java.lang.String getRFC1036Date​(java.util.Date date)  
      static java.lang.String getRFC1123Date​(long timeMillis)  
      static java.lang.String getRFC1123Date​(java.util.Date date)  
      static java.util.Date parseDate​(java.lang.String dateValue)  
      static java.util.Date parseRFC1123Date​(java.lang.String dateValue)  
      static DateUtils valueOf​(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.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • 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 name
        java.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