public static enum DateRange.DateRangeBound.Precision extends Enum<DateRange.DateRangeBound.Precision>
DateRange.DateRangeBound
.Enum Constant and Description |
---|
DAY |
HOUR |
MILLISECOND |
MINUTE |
MONTH |
SECOND |
YEAR |
Modifier and Type | Method and Description |
---|---|
Date |
roundDown(Date timestamp)
Rounds down the given timestamp to this precision.
|
Date |
roundUp(Date timestamp)
Rounds up the given timestamp to this precision.
|
static DateRange.DateRangeBound.Precision |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DateRange.DateRangeBound.Precision[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DateRange.DateRangeBound.Precision MILLISECOND
public static final DateRange.DateRangeBound.Precision SECOND
public static final DateRange.DateRangeBound.Precision MINUTE
public static final DateRange.DateRangeBound.Precision HOUR
public static final DateRange.DateRangeBound.Precision DAY
public static final DateRange.DateRangeBound.Precision MONTH
public static final DateRange.DateRangeBound.Precision YEAR
public static DateRange.DateRangeBound.Precision[] values()
for (DateRange.DateRangeBound.Precision c : DateRange.DateRangeBound.Precision.values()) System.out.println(c);
public static DateRange.DateRangeBound.Precision valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic Date roundUp(Date timestamp)
timestamp
- The timestamp to round up.public Date roundDown(Date timestamp)
timestamp
- The timestamp to round down.Copyright © 2012–2017. All rights reserved.