Clean up integer64 type

This commit is contained in:
jamesagnew 2020-11-01 14:00:12 -05:00
parent b7661db83e
commit 6cd0af3b8c
1 changed files with 31 additions and 37 deletions

View File

@ -31,14 +31,12 @@ package org.hl7.fhir.r5.model;
import org.hl7.fhir.instance.model.api.IBaseIntegerDatatype;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
/**
* Primitive type "integer" in FHIR: A signed 32-bit integer
* Primitive type "integer64" in FHIR: A signed 64-bit integer
*/
@DatatypeDef(name = "integer")
@DatatypeDef(name = "integer64")
public class Integer64Type extends PrimitiveType<Long> /* implements IBaseInteger64Datatype */ {
private static final long serialVersionUID = 3L;
@ -76,12 +74,8 @@ public class Integer64Type extends PrimitiveType<Long> /* implements IBaseIntege
* @throws IllegalArgumentException If the value is too large to fit in a signed integer
*/
public Integer64Type(Long theValue) {
if (theValue < java.lang.Long.MIN_VALUE || theValue > java.lang.Long.MAX_VALUE) {
throw new IllegalArgumentException
(theValue + " cannot be cast to int without changing its value.");
}
if(theValue!=null) {
setValue((long)theValue.longValue());
setValue(theValue);
}
}