gitからこのような提案がありました しかし、私はそれをどのように使用するのかわかりません。どこから呼び出すべきですか? retrofitはjson、xmlに変換できますが、オブジェクトとして変換する必要がありますデータと文字列も改造を使用してjsonオブジェクトと文字列を取得するデータを変換する方法は?
@GET("whatever")
Call<Pair<User, String>> whatever();
Type firstType = //reflection
Converter<ResponseBody, Object> delegate = retrofit.nextResponseBodyConverter(firstType, annotations);
return new Converter<ResponseBody, Pair<Object, String>>() {
@Override public Pair<Object, String> convert(ResponseBody body) {
String string = body.string();
Object object = delegate.convert(ResponseBody.create(null, string));
return new Pair<>(object, string);
}
};
私はそれを参照してください、私はそれを乗り越えます私は両方のデータを持っている必要がありますが、それは私の場合ではない、それは標準的なケースです –