🛠 Fixed a bad merge
🛠 This one is composed mostly by bugfixes and rework on how the tests are done and finally getting rid of Spek 1 which caused a lot of pain when trying to debug things, IDE exceptions etc...
- 🛠 Fixed #57
- 🛠 Fixed a bug where the equality of ConfigObjects wouldn't be true at some point
- ⚠ Now values aren't going to be overridden when a property has a root and children at the same time, a warning will be shown (it was already showing a warning if the root was direct)
- Now nulls won't be cached in
- ➕ Added support for lists inside properties objects. (CATCH: The order of the items in the list will be unpredictable, so don't rely on this if you need a sorted list)
👕 Now instead of Spek 1, Kotlintest is being used (latest version). With this rework I had to think better how to test and increase the test coverage. Also every file has its test file equivalent which was not true before, basically everything was a Functional test!
🚀 In this release a huge rework of the source code has been done. Some methods have been removed and some have been added from the API.
📜 1. Now it supports all kind of complex objects and maps. Everything will be transformed for you (not supported in properties, system properties or environment variables as the process to parse that into a root ConfigObject can be different in each case, you can always implement your own loader to do this). Some examples:
Map<String, Map<Int, List<String>>>📜 2. The signature for the
context: ConfigContext, value: ConfigObject, typeStructure: TypeStructure.
📜 Now it will receive an object which is the context (similar to Gson for example), where you will be able to parse a subtype or a property from your complex object. A new object has been introduced which is the
TypeStructurethis will hold the structure of the generic type of your object, for example from
List<List<Int>>, the type structure will be this:
- type: List<List> and generics: List
- type: List and generics: Int
🚚 3. Removed methods from the
get(name: String, type: Class<T>, default: T?): T
getOrNull(name: String, type: Class<T>, default: T?): T?👍 4. Added data class support, now data classes will be instantiated like if they were interfaces but not giving back a proxy but an actual instance of the class.
🚚 Those two methods have been removed in favor of the same method with the change of type,
type: Type. These methods should be better used with the extension functions
get<List<String>>()as they will hide for you the work of transforming a generic into a
DefaultConfigLoaderso merges and binding will work with them.
There is one caveat, that is the SystemProperty actually has something like:
⚠ Which is perfectly viable in properties. But when translating that to an object it cannot be represented (for example you cannot do that in JSON). If that happens a warning will be emitted and it will only happen with a java property in the SystemPropertyConfigLoader (or if you do the wrong thing in a properties file)
- ➕ Added sources for:
- StringRotation (list of strings that will be rotated on reload)
- Revamped ByteBuddyBinder and now it holds a cache so classes won't be recompiled everytime
- ➕ Added merge to ConfigLoader so you can merge before adding it to a provider.
- Reusable TimedReloadStrategy
- Auth in URLConfigSource
- Code cleaning up
- ➕ Added sources for:
v0.8October 29, 2017
v0.7.1August 05, 2017
- Nos lists can contain complex objects and the library will handle them all
- 🛠 Bugfixes and code improvements
v0.6.0July 11, 2017