如何将 List<SomeModel> 转换为改造 Response<SomeModel> kotlin

问题描述 投票:0回答:0

我有一些模型(数据类)的列表。我可以将它转换为改造 Response 包装器吗?
喜欢:

val list = List<DomainModel> 
val response: Response<SomePresentationModel> = list.map(domainToPresentationMapper::toPresentation) 

list kotlin retrofit2 converters
© www.soinside.com 2019 - 2024. All rights reserved.