Allow (de)serialization of Maps #319
Unanswered
Astralchroma
asked this question in
Support
Replies: 4 comments 2 replies
-
you should be anle to deserialize maps just fine, what is your issue? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
the issue you are having there is that you need to provide type parameters - look at the TypeToken overload. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Could it be caused by this function? It isn't shown on the stacktrace due to inlining. Not really sure why it's inlined really. inline fun <reified T> loadConfiguration(directory: File, fileName: String): T {
directory.mkdirs()
val loader = HoconConfigurationLoader.builder()
.path(directory.resolve(fileName).toPath())
.defaultOptions { options ->
options.serializers { builder ->
builder.registerAnnotatedObjects(objectMapperFactory())
}
}
.build()
val node = loader.load()
val configuration = node.get(T::class.java)!!
configuration.toNode(node)
loader.save(node)
return configuration
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Current work arround is to have a wrapper which works fine, but results in a slightly less clean configuration file.
Beta Was this translation helpful? Give feedback.
All reactions