Consider I have an object List<SShow>
and I am trying to take this object and convert to List<Show>
. I am able to do it for a single object but facing difficulty with parsing list here.
repository.getContentShow().map{
Show.from(it.shows.get(0))
}
Please guide me how can I be able to parse a list to Show object.Thanks
repository.getContentShow().map{
it.shows.map{ currentShow -> Show.from(currentShow) }
}
I think it should do the trick, just use kotlin Collection.map extension function with your list and return it from rxJava map function.