mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-20 19:56:09 +00:00
add Element.hasChildren
This commit is contained in:
parent
94dda85240
commit
8122ce591e
@ -604,6 +604,14 @@ public class Element extends Base {
|
||||
return getNamedChild(name) != null;
|
||||
}
|
||||
|
||||
public boolean hasChildren(String name) {
|
||||
if (children != null)
|
||||
for (Element child : children)
|
||||
if (child.getName().equals(name))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name+"="+fhirType() + "["+(children == null || hasValue() ? value : Integer.toString(children.size())+" children")+"]";
|
||||
|
Loading…
x
Reference in New Issue
Block a user