Class IntegerType

All Implemented Interfaces:
ca.uhn.fhir.model.api.IElement, 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.IBaseIntegerDatatype, org.hl7.fhir.instance.model.api.IPrimitiveType<Integer>
Direct Known Subclasses:
PositiveIntType, UnsignedIntType

public class IntegerType extends PrimitiveType<Integer> implements org.hl7.fhir.instance.model.api.IBaseIntegerDatatype
Primitive type "integer" in FHIR: A signed 32-bit integer
See Also:
  • Constructor Details

    • IntegerType

      public IntegerType()
      Constructor
    • IntegerType

      public IntegerType(int theInteger)
      Constructor
    • IntegerType

      public IntegerType(String theIntegerAsString)
      Constructor
      Parameters:
      theIntegerAsString - A string representation of an integer
      Throws:
      IllegalArgumentException - If the string is not a valid integer representation
    • IntegerType

      public IntegerType(Long theValue)
      Constructor
      Parameters:
      theValue - The value
      Throws:
      IllegalArgumentException - If the value is too large to fit in a signed integer
  • Method Details

    • parse

      protected Integer parse(String theValue)
      Description copied from class: PrimitiveType
      Subclasses must override to convert an encoded representation of this datatype into a "coerced" one
      Specified by:
      parse in class PrimitiveType<Integer>
      Parameters:
      theValue - Will not be null
      Returns:
      May return null if the value does not correspond to anything
    • encode

      protected String encode(Integer theValue)
      Description copied from class: PrimitiveType
      Subclasses must override to convert a "coerced" value into an encoded one.
      Specified by:
      encode in class PrimitiveType<Integer>
      Parameters:
      theValue - Will not be null
      Returns:
      May return null if the value does not correspond to anything
    • copy

      public IntegerType copy()
      Specified by:
      copy in class PrimitiveType<Integer>
    • fhirType

      public String fhirType()
      Specified by:
      fhirType in interface org.hl7.fhir.instance.model.api.IBase
      Overrides:
      fhirType in class Element