Enum DateRangePrecision

    • Method Detail

      • values

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

        public static DateRangePrecision valueOf​(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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getEncoding

        public byte getEncoding()
        The code used to represent the precision when a date range is encoded to binary.
      • roundUp

        @NonNull
        public ZonedDateTime roundUp​(@NonNull
                                     ZonedDateTime timestamp)
        Rounds up the given timestamp to this precision.

        Temporal fields smaller than this precision will be rounded up; other fields will be left untouched.

      • roundDown

        @NonNull
        public ZonedDateTime roundDown​(@NonNull
                                       ZonedDateTime timestamp)
        Rounds down the given timestamp to this precision.

        Temporal fields smaller than this precision will be rounded down; other fields will be left untouched.

      • format

        public String format​(ZonedDateTime timestamp)
        Formats the given timestamp according to this precision.