Enum TimestampStyle

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

    public enum TimestampStyle
    extends java.lang.Enum<TimestampStyle>
    The enum contains all different types of timestamp styles.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static TimestampStyle byStyle​(java.lang.String timestampStyle)
      Gets the type by its int representation.
      java.lang.String getTimestampStyle()
      Gets the timestamp style name.
      java.lang.String getTimestampTag​(long epochSeconds)
      Gets the timestamp tag used in messages.
      java.lang.String getTimestampTag​(java.time.Instant instant)
      Gets the timestamp tag used in messages.
      static TimestampStyle valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static TimestampStyle[] 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

      • SHORT_TIME

        public static final TimestampStyle SHORT_TIME
        Displayed as: 16:20.
      • LONG_TIME

        public static final TimestampStyle LONG_TIME
        Displayed as: 16:20:30.
      • SHORT_DATE

        public static final TimestampStyle SHORT_DATE
        Displayed as: 20/04/2021.
      • LONG_DATE

        public static final TimestampStyle LONG_DATE
        Displayed as: 20 April 2021.
      • SHORT_DATE_TIME

        public static final TimestampStyle SHORT_DATE_TIME
        Displayed as: 20 April 2021 16:20.
      • LONG_DATE_TIME

        public static final TimestampStyle LONG_DATE_TIME
        Displayed as: Tuesday, 20 April 2021 16:20.
      • RELATIVE_TIME

        public static final TimestampStyle RELATIVE_TIME
        Displayed as: 2 months ago.
      • UNKNOWN

        public static final TimestampStyle UNKNOWN
        An unknown timestamp style.
    • Method Detail

      • values

        public static TimestampStyle[] 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 (TimestampStyle c : TimestampStyle.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static TimestampStyle 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
      • byStyle

        public static TimestampStyle byStyle​(java.lang.String timestampStyle)
        Gets the type by its int representation.
        Parameters:
        timestampStyle - The String representation.
        Returns:
        The timestamp style.
      • getTimestampStyle

        public java.lang.String getTimestampStyle()
        Gets the timestamp style name.
        Returns:
        The name of the timestamp style.
      • getTimestampTag

        public java.lang.String getTimestampTag​(long epochSeconds)
        Gets the timestamp tag used in messages.
        Parameters:
        epochSeconds - The epoch seconds of the timestamp.
        Returns:
        The tag of the timestamp.
      • getTimestampTag

        public java.lang.String getTimestampTag​(java.time.Instant instant)
        Gets the timestamp tag used in messages.
        Parameters:
        instant - An instant of the time that should be displayed with this timestamp.
        Returns:
        The tag of the timestamp.