Improve efficiency of isEmpty() methods

This commit is contained in:
James Agnew 2019-10-13 19:39:19 -04:00
parent d3ab74a8e3
commit 0cf2cafb62
3 changed files with 20 additions and 0 deletions
org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/model
org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model
org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model

@ -147,4 +147,11 @@ public class Base64BinaryType extends PrimitiveType<byte[]> implements IPrimitiv
return myValue != null && myValue.length > 0;
}
@Override
public boolean isEmpty() {
// Custom isEmpty() in order to avoid generating the text representation unneccessarily
return ca.uhn.fhir.util.ElementUtil.isEmpty(id, extension) && !hasValue();
}
}

@ -148,4 +148,10 @@ public class Base64BinaryType extends PrimitiveType<byte[]> implements IPrimitiv
return myValue != null && myValue.length > 0;
}
@Override
public boolean isEmpty() {
// Custom isEmpty() in order to avoid generating the text representation unneccessarily
return ca.uhn.fhir.util.ElementUtil.isEmpty(id, extension) && !hasValue();
}
}

@ -148,4 +148,11 @@ public class Base64BinaryType extends PrimitiveType<byte[]> implements IPrimitiv
return myValue != null && myValue.length > 0;
}
@Override
public boolean isEmpty() {
// Custom isEmpty() in order to avoid generating the text representation unneccessarily
return ca.uhn.fhir.util.ElementUtil.isEmpty(id, extension) && !hasValue();
}
}