Class InstantType

All Implemented Interfaces:
ca.uhn.fhir.model.api.IElement, Externalizable, Serializable, org.hl7.fhir.instance.model.api.IBase, org.hl7.fhir.instance.model.api.IBaseDatatype, org.hl7.fhir.instance.model.api.IBaseElement, org.hl7.fhir.instance.model.api.IBaseHasExtensions, org.hl7.fhir.instance.model.api.IPrimitiveType<Date>

public class InstantType
extends BaseDateTimeType
Represents a FHIR instant datatype. Valid precisions values for this type are:
  • TemporalPrecisionEnum.SECOND
  • TemporalPrecisionEnum.MILLI
See Also:
Serialized Form
  • Field Details

    • DEFAULT_PRECISION

      public static final ca.uhn.fhir.model.api.TemporalPrecisionEnum DEFAULT_PRECISION
      The default precision for this type
  • Constructor Details

    • InstantType

      public InstantType()
      Constructor which creates an InstantDt with no timne value. Note that unlike the default constructor for the Java Date or Calendar objects, this constructor does not initialize the object with the current time.
      See Also:
      to create a new object that has been initialized with the current time.
    • InstantType

      public InstantType​(Calendar theCalendar)
      Create a new DateTimeDt
    • InstantType

      public InstantType​(Date theDate, ca.uhn.fhir.model.api.TemporalPrecisionEnum thePrecision, TimeZone theTimezone)
      Create a new instance using the given date, precision level, and time zone
      Throws:
      DataFormatException - If the specified precision is not allowed for this type
    • InstantType

      public InstantType​(BaseDateTimeType theDateTime)
      Create a new DateTimeDt using an existing value. Use this constructor with caution, as it may create more precision than warranted (since for example it is possible to pass in a DateTime with only a year, and this constructor will convert to an InstantDt with milliseconds precision).
    • InstantType

      public InstantType​(Date theDate)
      Create a new DateTimeDt with the given date/time and TemporalPrecisionEnum.MILLI precision
    • InstantType

      public InstantType​(Date theDate, ca.uhn.fhir.model.api.TemporalPrecisionEnum thePrecision)
      Constructor which accepts a date value and a precision value. Valid precisions values for this type are:
      • TemporalPrecisionEnum.SECOND
      • TemporalPrecisionEnum.MILLI
    • InstantType

      public InstantType​(String theString)
      Create a new InstantDt from a string value
      Parameters:
      theString - The string representation of the string. Must be in a valid format according to the FHIR specification
      Throws:
      DataFormatException
  • Method Details