OkaeriPoland / okaeri-configs

Simple Java/POJO config library written with love and Lombok
MIT License
83 stars 11 forks source link

Create methods to return default value in deserialization #37

Closed P3ridot closed 1 year ago

dasavick commented 1 year ago

I have mixed feelings about these, because there are different concepts, such as presence (#containsKey check) and nullity wrapped into a single orDefault suffix.

Basically double the amount of methods in the class with potential misinterpretation risks. Arguably the methods only hide the real conditions and are even more messy due to increased argument count.

There could be a huge difference between key: null and no key at all. One may be used for disabling some function, and the other for the actual default value. Due to that, I feel there is no other option than leaving the final choice of the condition to the developers.