cfg4k v0.9.3 Release Notes

Release Date: 2019-03-05 // about 5 years ago
  • ๐Ÿš€ 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:

    1. List<List<Int>>
    2. Map<String, Map<Int, List<String>>> ๐Ÿ“œ 2. The signature for the Parser has changed: 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 TypeStructure this will hold the structure of the generic type of your object, for example from List<List<Int>>, the type structure will be this:
    3. type: List<List> and generics: List
    4. type: List and generics: Int ๐Ÿšš 3. Removed methods from the ConfigProvider interface:
    5. get(name: String, type: Class<T>, default: T?): T
    6. 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 Type object.