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:
List<List<Int>>
Map<String, Map<Int, List<String>>>
๐ 2. The signature for theParser
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 theTypeStructure
this will hold the structure of the generic type of your object, for example fromList<List<Int>>
, the type structure will be this:- type: List<List> and generics: List
- type: List and generics: Int
๐ 3. Removed methods from the
ConfigProvider
interface: 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 functionsget<List<String>>()
as they will hide for you the work of transforming a generic into aType
object.