How do I create a list of custom objects using fields from a another object?
I need to create a customized list of objects using fields from another object in Kotlin. For example, say I have an JSON object FruitBasketList structured in such a way.
[{
"color": "brown",
"weight": 4,
"fruits": {
"differentTypes": 3,
"rotten: true
}
},
{
"color": "white",
"weight": 2,
"fruits": {
"differentTypes": 2,
"rotten": false
}
}]
I want to create a create a custom list of objects, only using a few of the necessary fields from the...