Added the copying of "extension" fiels
This commit is contained in:
parent
c422ddc388
commit
c8fa589baa
|
@ -34,6 +34,7 @@ package org.hl7.fhir.r4.model;
|
|||
import java.io.IOException;
|
||||
import java.io.ObjectInput;
|
||||
import java.io.ObjectOutput;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.hl7.fhir.instance.model.api.IBaseEnumeration;
|
||||
|
||||
|
@ -117,10 +118,17 @@ public class Enumeration<T extends Enum<?>> extends PrimitiveType<T> implements
|
|||
setValue(theValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<T> copy() {
|
||||
return new Enumeration<T>(myEnumFactory, getValue());
|
||||
}
|
||||
@Override
|
||||
public Enumeration<T> copy() {
|
||||
Enumeration dst= new Enumeration(this.myEnumFactory, (Enum)this.getValue());
|
||||
//Copy the Extension
|
||||
if (extension != null) {
|
||||
dst.extension = new ArrayList();
|
||||
for (Extension i : extension)
|
||||
dst.extension.add(i.copy());
|
||||
};
|
||||
return dst;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String encode(T theValue) {
|
||||
|
|
|
@ -34,6 +34,7 @@ package org.hl7.fhir.r5.model;
|
|||
import java.io.IOException;
|
||||
import java.io.ObjectInput;
|
||||
import java.io.ObjectOutput;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.hl7.fhir.instance.model.api.IBaseEnumeration;
|
||||
|
||||
|
@ -117,10 +118,17 @@ public class Enumeration<T extends Enum<?>> extends PrimitiveType<T> implements
|
|||
setValue(theValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<T> copy() {
|
||||
return new Enumeration<T>(myEnumFactory, getValue());
|
||||
}
|
||||
@Override
|
||||
public Enumeration<T> copy() {
|
||||
Enumeration dst= new Enumeration(this.myEnumFactory, (Enum)this.getValue());
|
||||
//Copy the Extension
|
||||
if (extension != null) {
|
||||
dst.extension = new ArrayList();
|
||||
for (Extension i : extension)
|
||||
dst.extension.add(i.copy());
|
||||
};
|
||||
return dst;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String encode(T theValue) {
|
||||
|
|
Loading…
Reference in New Issue