Class InputDate
- java.lang.Object
-
- com.identityworksllc.iiq.common.plugin.vo.InputDate
-
public class InputDate extends Object
The JAX-RS spec requires that an input bean forQueryParamorPathParamhave either a String constructor or a static valueOf(String) method.This is that bean, for dates.
The string input must either the ISO8601 local date, offset date time, or instant formats. Other formats will not be interpreted successfully.
The stored value will be a
ZonedDateTimeby default.- See Also:
- QueryParam
-
-
Constructor Summary
Constructors Constructor Description InputDate(long input)Constructs a new InputDate from a long valueInputDate(Instant from)Constructs a new InputDate from an instantInputDate(ZonedDateTime zdt)Constructs a new InputDate from a ZonedDateTime.InputDate(Date input)Constructs a new InputDate from aDate
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longtoEpochMillis()Returns the epoch millisecond rendition of the dateDatetoJavaData()Returns the java.util.Date objectStringtoString()ZonedDateTimetoZonedDateTime()Returns the input date as a ZonedDateTimestatic InputDatevalueOf(String input)Translates the String to an InputDate.
-
-
-
Constructor Detail
-
InputDate
public InputDate(long input)
Constructs a new InputDate from a long value- Parameters:
input- an epoch millisecond timestamp
-
InputDate
public InputDate(Instant from)
Constructs a new InputDate from an instant- Parameters:
from- An instant
-
InputDate
public InputDate(Date input)
Constructs a new InputDate from aDate- Parameters:
input- The input date
-
InputDate
public InputDate(ZonedDateTime zdt)
Constructs a new InputDate from a ZonedDateTime.The value is stored directly in this class.
- Parameters:
zdt- TheZonedDateTimeinput
-
-
Method Detail
-
valueOf
public static InputDate valueOf(String input)
Translates the String to an InputDate.This is the method required by JAX-RS.
- Parameters:
input- The input string, in either epoch milliseconds or ISO8601 format- Returns:
- The InputDate
-
toEpochMillis
public long toEpochMillis()
Returns the epoch millisecond rendition of the date- Returns:
- The date in epoch milliseconds
-
toJavaData
public Date toJavaData()
Returns the java.util.Date object- Returns:
- The java date object
-
toZonedDateTime
public ZonedDateTime toZonedDateTime()
Returns the input date as a ZonedDateTime- Returns:
- The ZonedDateTime
-
-