gpt4 book ai didi

kotlin - 如何在Android Studio 3.0下的代码.parseList {DayForecast(HashMap(it))}中显示它的值?

转载 作者:行者123 更新时间:2023-12-02 13:39:05 24 4
gpt4 key购买 nike

以下示例代码来自https://github.com/antoniolg/Kotlin-for-Android-Developers/blob/master/app/src/main/java/com/antonioleiva/weatherapp/data/db/ForecastDb.kt

我希望在代码.parseList{ DayForecast(HashMap(it)) }中显示“it”的值

因此,我在代码val dailyForecast ...之前设置了一个断点,然后在Android Studio中单击运行->调试'app菜单,按F7键启动Step Into,但是我找不到如何在代码.parseList{ DayForecast(HashMap(it)) }中找到“it”的值

我能怎么做?谢谢!

override fun requestForecastByZipCode(zipCode: Long, date: Long) = forecastDbHelper.use {

val dailyRequest = "${DayForecastTable.CITY_ID} = ? AND ${DayForecastTable.DATE} >= ?"
val dailyForecast = select(DayForecastTable.NAME)
.whereSimple(dailyRequest, zipCode.toString(), date.toString())
.parseList { DayForecast(HashMap(it)) }

val city = select(CityForecastTable.NAME)
.whereSimple("${CityForecastTable.ID} = ?", zipCode.toString())
.parseOpt { CityForecast(HashMap(it), dailyForecast) }


city?.let { dataMapper.convertToDomain(it) }

}

最佳答案

您可以临时为其命名:

.parseList { 
val map = it
DayForecast(HashMap(it))
}

关于kotlin - 如何在Android Studio 3.0下的代码.parseList {DayForecast(HashMap(it))}中显示它的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47148467/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com