If a field is a
Map
and the key of the map is inside values ( in a field ), you can write map as list of these values, so a map :
map = {
"key1" : {
id = "key1"
foo = 10
}
"key2" : {
id = "key2"
foo = 11
}
}
Can be replaced by :
map = {
{
id = "key1"
foo = 10
}
{
id = "key2"
foo = 11
}
}
using this annotations :
@OdinMapAsList(keyField = "id")
Map<String, Foo> map;
If the field value is an implementation of the field type and the implementation type also have an adapter registered in Odin, this adapter is forced and still used.