commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafał Figas (JIRA) <>
Subject [jira] [Created] (CONFIGURATION-654) Add optionalConfigurationAt method to HierarchicalConfiguration
Date Fri, 17 Mar 2017 08:21:41 GMT
Rafał Figas created CONFIGURATION-654:

             Summary: Add optionalConfigurationAt method to HierarchicalConfiguration
                 Key: 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
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

View raw message