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;
|
||||
|
||||
|
@ -119,7 +120,14 @@ public class Enumeration<T extends Enum<?>> extends PrimitiveType<T> implements
|
|||
|
||||
@Override
|
||||
public Enumeration<T> copy() {
|
||||
return new Enumeration<T>(myEnumFactory, getValue());
|
||||
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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -119,7 +120,14 @@ public class Enumeration<T extends Enum<?>> extends PrimitiveType<T> implements
|
|||
|
||||
@Override
|
||||
public Enumeration<T> copy() {
|
||||
return new Enumeration<T>(myEnumFactory, getValue());
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue