public class InstantDt extends BaseDateTimeDt
| Modifier and Type | Field and Description |
|---|---|
static TemporalPrecisionEnum |
DEFAULT_PRECISION
The default precision for this type
|
| Constructor and Description |
|---|
InstantDt()
Constructor which creates an InstantDt with no timne value.
|
InstantDt(BaseDateTimeDt theDateTime)
Create a new DateTimeDt using an existing value.
|
InstantDt(Calendar theCalendar)
Create a new DateTimeDt
|
InstantDt(Date theDate)
Create a new DateTimeDt with the given date/time and
TemporalPrecisionEnum.MILLI precision |
InstantDt(Date theDate,
TemporalPrecisionEnum thePrecision)
Constructor which accepts a date value and a precision value.
|
InstantDt(Date theDate,
TemporalPrecisionEnum thePrecision,
TimeZone theTimezone)
Create a new instance using the given date, precision level, and time zone
|
InstantDt(String theString)
Create a new InstantDt from a string value
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
after(Date theDate)
Invokes
Date.after(Date) on the contained Date against the given
date |
boolean |
before(Date theDate)
Invokes
Date.before(Date) on the contained Date against the given
date |
protected TemporalPrecisionEnum |
getDefaultPrecisionForDatatype()
Returns the default precision for this datatype
|
void |
setToCurrentTimeInLocalTimeZone()
Sets the value of this instant to the current time (from the system
clock) and the local/default timezone (as retrieved using
TimeZone.getDefault(). |
static InstantDt |
withCurrentTime()
Factory method which creates a new InstantDt with millisecond precision and initializes it with the
current time and the system local timezone.
|
encode, getPrecision, getTimeZone, isTimeZoneZulu, isToday, parse, setPrecision, setTimeZone, setTimeZoneZulu, setValue, setValue, setValueAsString, toHumanDisplay, toHumanDisplayLocalTimezoneequals, getValue, getValueAsString, hashCode, isEmpty, readExternal, toString, updateStringValue, writeExternalgetElementSpecificId, getId, setElementSpecificId, setId, setIdaddUndeclaredExtension, addUndeclaredExtension, addUndeclaredExtension, getAllUndeclaredExtensions, getUndeclaredExtensions, getUndeclaredExtensionsByUrl, getUndeclaredModifierExtensions, isBaseEmptypublic static final TemporalPrecisionEnum DEFAULT_PRECISION
public InstantDt()
public InstantDt(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimezone)
DataFormatException - If the specified precision is not allowed for this typepublic InstantDt(BaseDateTimeDt theDateTime)
public InstantDt(Date theDate)
TemporalPrecisionEnum.MILLI precisionpublic InstantDt(Date theDate, TemporalPrecisionEnum thePrecision)
public InstantDt(String theString)
theString - The string representation of the string. Must be in a valid
format according to the FHIR specificationDataFormatExceptionpublic boolean after(Date theDate)
Date.after(Date) on the contained Date against the given
dateNullPointerException - If the contained Date is nullpublic boolean before(Date theDate)
Date.before(Date) on the contained Date against the given
dateNullPointerException - If the contained Date is nullpublic void setToCurrentTimeInLocalTimeZone()
TimeZone.getDefault(). This TimeZone is generally obtained from
the underlying OS.public static InstantDt withCurrentTime()
protected TemporalPrecisionEnum getDefaultPrecisionForDatatype()
getDefaultPrecisionForDatatype in class BaseDateTimeDtDEFAULT_PRECISIONCopyright © 2014–2016 University Health Network. All rights reserved.