在 Json 中,我有以下
{ "@odata.context":"https://te.avolutionsoftware.com/api/$metadata#Components/$entity"
當我將 Json 翻譯成 java 時,我得到以下資訊:
private String @odata.context;
并且編譯器不允許這樣做。
知道如何讀取這個變數,特別是在 Gson 庫中,或者一般要搜索什么?
uj5u.com熱心網友回復:
@SerializedName 可能會對您有所幫助。像這樣:
public final class Context {
@SerializedName("@odata.context")
public String context;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/497246.html
上一篇:nhandled例外:NoSuchMethodError:類'_InternalLinkedHashMap<String,dynamic>'沒有實體方法'ca
