[
https://issues.apache.org/jira/browse/CONFIGURATION-664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15983146#comment-15983146
]
Gary Gregory commented on CONFIGURATION-664:
--------------------------------------------
I can see that {{configurationAt(String)}} can be made to work with my use
case, but (at least for now), I am not going to fiddle with my code that
implements its own private version of {{getChildren()}} and all call its sites.
I'm on to fighting another fire ;-) I still think there can be use cases for
the API though if {{configurationAt(String)}} ever falls short.
> Add API
> org.apache.commons.configuration2.tree.ImmutableNode.getChildren(String)
> --------------------------------------------------------------------------------
>
> Key: CONFIGURATION-664
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-664
> Project: Commons Configuration
> Issue Type: New Feature
> Reporter: Gary Gregory
> Assignee: Gary Gregory
> Fix For: 2.2
>
>
> Add API
> org.apache.commons.configuration2.tree.ImmutableNode.getChildren(String):
> {code:java}
> /**
> * Returns a list with the children of this node. This list cannot be
> * modified.
> * @param name the node name to find
> *
> * @return a list with the child nodes
> */
> public List<ImmutableNode> getChildren(final String name)
> {
> final List<ImmutableNode> list = new ArrayList<>();
> if (name == null) {
> return list;
> }
> for (final ImmutableNode node : children)
> {
> if (name.equals(node.getNodeName()))
> {
> list.add(node);
> }
> }
> return list;
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)