mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-08 05:48:12 +00:00
generate enum add routine
This commit is contained in:
parent
17b22424f6
commit
69b96d8d3e
@ -594,13 +594,20 @@ public class PECodeGenerator {
|
||||
w(accessors, " return "+name+" != null && !"+name+".isEmpty();");
|
||||
w(accessors, " }");
|
||||
w(accessors);
|
||||
if (!isAbstract && !isEnum) {
|
||||
w(accessors, " public "+type+" add"+csname+"() {");
|
||||
w(accessors, " "+type+" theThing = new "+type+"();");
|
||||
w(accessors, " get"+cname+"().add(theThing);");
|
||||
w(accessors, " return theThing;");
|
||||
w(accessors, " }");
|
||||
w(accessors);
|
||||
if (!isAbstract) {
|
||||
if (!isEnum) {
|
||||
w(accessors, " public "+type+" add"+csname+"() {");
|
||||
w(accessors, " "+type+" theThing = new "+type+"();");
|
||||
w(accessors, " get"+cname+"().add(theThing);");
|
||||
w(accessors, " return theThing;");
|
||||
w(accessors, " }");
|
||||
w(accessors);
|
||||
} else {
|
||||
w(accessors, " public void add"+csname+"("+type+" theThing) {");
|
||||
w(accessors, " get"+cname+"().add(theThing);");
|
||||
w(accessors, " }");
|
||||
w(accessors);
|
||||
}
|
||||
}
|
||||
w(accessors, " public boolean has"+csname+"("+type+" item) {");
|
||||
w(accessors, " return has"+cname+"() && "+name+".contains(item);");
|
||||
|
@ -600,13 +600,20 @@ public class PECodeGenerator {
|
||||
w(accessors, " return "+name+" != null && !"+name+".isEmpty();");
|
||||
w(accessors, " }");
|
||||
w(accessors);
|
||||
if (!isAbstract && !isEnum) {
|
||||
w(accessors, " public "+type+" add"+csname+"() {");
|
||||
w(accessors, " "+type+" theThing = new "+type+"();");
|
||||
w(accessors, " get"+cname+"().add(theThing);");
|
||||
w(accessors, " return theThing;");
|
||||
w(accessors, " }");
|
||||
w(accessors);
|
||||
if (!isAbstract) {
|
||||
if (!isEnum) {
|
||||
w(accessors, " public "+type+" add"+csname+"() {");
|
||||
w(accessors, " "+type+" theThing = new "+type+"();");
|
||||
w(accessors, " get"+cname+"().add(theThing);");
|
||||
w(accessors, " return theThing;");
|
||||
w(accessors, " }");
|
||||
w(accessors);
|
||||
} else {
|
||||
w(accessors, " public void add"+csname+"("+type+" theThing) {");
|
||||
w(accessors, " get"+cname+"().add(theThing);");
|
||||
w(accessors, " }");
|
||||
w(accessors);
|
||||
}
|
||||
}
|
||||
w(accessors, " public boolean has"+csname+"("+type+" item) {");
|
||||
w(accessors, " return has"+cname+"() && "+name+".contains(item);");
|
||||
|
Loading…
x
Reference in New Issue
Block a user