Rafał Figas created CONFIGURATION-654:
-----------------------------------------
Summary: Add optionalConfigurationAt method to
HierarchicalConfiguration
Key: CONFIGURATION-654
URL: https://issues.apache.org/jira/browse/CONFIGURATION-654
Project: Commons Configuration
Issue Type: Improvement
Reporter: Rafał Figas
It would be nice to have method similar to configurationAt, but expecting that
there is one or no configuration at given key.
Currently there is no easy way to handle optional node in configuration. One
has to handle exception from configurationAt or use configurationsAt and do
various checks on collection size.
Method optionalConfigurationAt could return configuration at given key if
exactly one exists, return empty Optional or null, when there is no node,
exception when more then one node exists.
Method could throw exception like "UnexpectedMultipleNodesException' containing
key name, what would be helpful for clear error handling.
It would be very helpful while handling optional nodes.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)