Enum DateRangePrecision
- java.lang.Object
-
- java.lang.Enum<DateRangePrecision>
-
- com.datastax.dse.driver.api.core.data.time.DateRangePrecision
-
- All Implemented Interfaces:
Serializable,Comparable<DateRangePrecision>
public enum DateRangePrecision extends Enum<DateRangePrecision>
The precision of aDateRangeBound.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringformat(ZonedDateTime timestamp)Formats the given timestamp according to this precision.static DateRangePrecisionfromEncoding(byte encoding)bytegetEncoding()The code used to represent the precision when a date range is encoded to binary.ZonedDateTimeroundDown(ZonedDateTime timestamp)Rounds down the given timestamp to this precision.ZonedDateTimeroundUp(ZonedDateTime timestamp)Rounds up the given timestamp to this precision.static DateRangePrecisionvalueOf(String name)Returns the enum constant of this type with the specified name.static DateRangePrecision[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MILLISECOND
public static final DateRangePrecision MILLISECOND
-
SECOND
public static final DateRangePrecision SECOND
-
MINUTE
public static final DateRangePrecision MINUTE
-
HOUR
public static final DateRangePrecision HOUR
-
DAY
public static final DateRangePrecision DAY
-
MONTH
public static final DateRangePrecision MONTH
-
YEAR
public static final DateRangePrecision YEAR
-
-
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 nameNullPointerException- if the argument is null
-
fromEncoding
public static DateRangePrecision fromEncoding(byte encoding)
-
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.
-
-