Java中Json字串直接轉換為物件的方法(包括多層List集合)
阿新 • • 發佈:2019-01-04
{
"error"
:
0
,
"status"
:
"success"
,
"date"
:
"2015-01-15"
,
"results"
:[{
"currentCity"
:
"南京"
,
"pm25"
:
"83"
,
"index"
:[{
"title"
:
"穿衣"
,
"zs"
:
"較冷"
,
"tipt"
:
"穿衣指數"
,
"des"
:
"建議著厚外套加毛衣等服裝。年老體弱者宜著大衣、呢外套加羊毛衫。"
},{
"title"
:
"洗車"
,
"zs"
:
"較適宜"
,
"tipt"
:
"洗車指數"
,
"des"
:
"較適宜洗車,未來一天無雨,風力較小,擦洗一新的汽車至少能保持一天。"
},{
"title"
:
"旅遊"
,
"zs"
:
"適宜"
,
"tipt"
:
"旅遊指數"
,
"des"
:
"天氣較好,氣溫稍低,會感覺稍微有點涼,不過也是個好天氣哦。適宜旅遊,可不要錯過機會呦!"
},{
"title"
:
"感冒"
,
"zs"
:
"少發"
,
"tipt"
:
"感冒指數"
,
"des"
:
"各項氣象條件適宜,無明顯降溫過程,發生感冒機率較低。"
},{
"title"
:
"運動"
,
"zs"
:
"較不宜"
,
"tipt"
:
"運動指數"
,
"des"
:
"陰天,且天氣寒冷,推薦您在室內進行低強度運動;若堅持戶外運動,請選擇合適的運動並注意保暖。"
},{
"title"
:
"紫外線強度"
,
"zs"
:
"最弱"
,
"tipt"
:
"紫外線強度指數"
,
"des"
:
"屬弱紫外線輻射天氣,無需特別防護。若長期在戶外,建議塗擦SPF在8-12之間的防晒護膚品。"
}],
"weather_data"
:[{
"date"
:
"週四
01月15日 (實時:6℃)"
,
"dayPictureUrl"
:
,
"nightPictureUrl"
:
,
"weather"
:
"陰轉多雲"
,
"wind"
:
"北風微風"
,
"temperature"
:
"8
~ 4℃"
},{
"date"
:
"週五"
,
"dayPictureUrl"
:
,
"nightPictureUrl"
:
,
"weather"
:
"多雲轉晴"
,
"wind"
:
"西北風3-4級"
,
"temperature"
:
"12
~ 0℃"
},{
"date"
:
"週六"
,
"dayPictureUrl"
:
,
"nightPictureUrl"
:
,
"weather"
:
"晴轉多雲"
,
"wind"
:
"東北風3-4級"
,
"temperature"
:
"8
~ 0℃"
},{
"date"
:
"週日"
,
"dayPictureUrl"
:
,
"nightPictureUrl"
:
,
"weather"
:
"晴"
,
"wind"
:
"西風微風"
,
"temperature"
:
"10
~ -1℃"
}]},{
"currentCity"
:
"徐州"
,
"pm25"
:
"154"
,
"index"
:[{
"title"
:
"穿衣"
,
"zs"
:
"較冷"
,
"tipt"
:
"穿衣指數"
,
"des"
:
"建議著厚外套加毛衣等服裝。年老體弱者宜著大衣、呢外套加羊毛衫。"
},{
"title"
:
"洗車"
,
"zs"
:
"較適宜"
,
"tipt"
:
"洗車指數"
,
"des"
:
"較適宜洗車,未來一天無雨,風力較小,擦洗一新的汽車至少能保持一天。"
},{
"title"
:
"旅遊"
,
"zs"
:
"適宜"
,
"tipt"
:
"旅遊指數"
,
"des"
:
"天氣較好,但絲毫不會影響您出行的心情。溫度適宜又有微風相伴,適宜旅遊。"
},{
"title"
:
"感冒"
,
"zs"
:
"較易發"
,
"tipt"
:
"感冒指數"
,
"des"
:
"天氣較涼,較易發生感冒,請適當增加衣服。體質較弱的朋友尤其應該注意防護。"
},{
"title"
:
"運動"
,
"zs"
:
"較不宜"
,
"tipt"
:
"運動指數"
,
"des"
:
"天氣較好,但考慮天氣寒冷,推薦您進行各種室內運動,若在戶外運動請注意保暖並做好準備活動。"
},{
"title"
:
"紫外線強度"
,
"zs"
:
"最弱"
,
"tipt"
:
"紫外線強度指數"
,
"des"
:
"屬弱紫外線輻射天氣,無需特別防護。若長期在戶外,建議塗擦SPF在8-12之間的防晒護膚品。"
}],
"weather_data"
:[{
"date"
:
"週四
01月15日 (實時:6℃)"
,
"dayPictureUrl"
:
,
"nightPictureUrl"
:
,
"weather"
:
"多雲"
,
"wind"
:
"南風微風"
,
"temperature"
:
"10
~ 3℃"
},{
"date"
:
"週五"
,
"dayPictureUrl"
:
,
"nightPictureUrl"
:
,
"weather"
:
"多雲"
,
"wind"
:
"北風3-4級"
,
"temperature"
:
"11
~ -4℃"
},{
"date"
:
"週六"
,
"dayPictureUrl"
:
,
"nightPictureUrl"
:
,
"weather"
:
"多雲"
,
"wind"
:
"東風微風"
,
"temperature"
:
"6
~ -4℃"
},{
"date"
:
"週日"
,
"dayPictureUrl"
:
,
"nightPictureUrl"
:
,
"weather"
:
"多雲"
,
"wind"
:
"西風3-4級"
,
"temperature"
:
"11
~ -1℃"
}]}]}