AuthMe / ConfigMe

A simple configuration management library for any Java project!
MIT License
37 stars 14 forks source link

Add PropertyReader extension for key methods #372

Open ljacqu opened 1 year ago

ljacqu commented 1 year ago

Not sure about this one yet, but on PropertyReader: getKeys and getChildKeys is not used by ConfigMe, and I've been throwing UnsupportedOperationException in custom reader implementations I've created. It might be nicer to introduce an extension to PropertyReader and have the existing YamlFileReader implement it, so that whoever needs the child keys can get them, without having to create the methods if they're not of interest. ConfigMe doesn't need them anywhere.

Interestingly, with the new property type implementations, we don't need any methods except contains and getObject. The question is whether we should also drop getBoolean and friends, or provide default methods for them... I think keeping the methods is not so bad, since they're useful in the migration service. Then again, the best way to get old values from the reader is to create a new Property in the method and to extract values like that.