GSON: Google Java API 用于转换 JAVA Object <-> JSON String
http://www.importnew.com/16630.html
http://blog.csdn.net/lk_blog/article/details/7685169
com.mediatek.eb.entity
ApiMessageEntity (errorDetail/message/code, fromJson->ApiMessageEntity)
—— ApiResponsesEntity<T> (List<T> results)
—— SleepReportsEntity etc. (属性, toJson(this)->string, fromJson->自己类, getResultsFromJson->List<T>)
—— ApiResponseEntity (Object results以及getResultsString(json string))
—— ProfileEntity etc. (属性, toJson(this)->string, fromJson->自己类)
Entity json demo
EB\EB-android\app\src\debug\assets\test-seeds\api
Q & A
为什么不用gson.fromJson(json, Entity.class);直接转出Entity,要用ApiResponseEntity get result中间转一道呢??
—— 因为json结构是for ApiResponseEntity的,其下results才是entity对应的json.
http://www.importnew.com/16630.html
http://blog.csdn.net/lk_blog/article/details/7685169
com.mediatek.eb.entity
ApiMessageEntity (errorDetail/message/code, fromJson->ApiMessageEntity)
—— ApiResponsesEntity<T> (List<T> results)
—— SleepReportsEntity etc. (属性, toJson(this)->string, fromJson->自己类, getResultsFromJson->List<T>)
—— ApiResponseEntity (Object results以及getResultsString(json string))
—— ProfileEntity etc. (属性, toJson(this)->string, fromJson->自己类)
Entity json demo
EB\EB-android\app\src\debug\assets\test-seeds\api
Q & A
为什么不用gson.fromJson(json, Entity.class);直接转出Entity,要用ApiResponseEntity get result中间转一道呢??
—— 因为json结构是for ApiResponseEntity的,其下results才是entity对应的json.