change java default lib to okhttp-gson

This commit is contained in:
wing328
2016-07-06 22:10:00 +08:00
parent d402f35711
commit 3b780e30d8
127 changed files with 5393 additions and 3484 deletions

View File

@@ -790,6 +790,7 @@ public class ApiClient {
* @throws ApiException If fail to deserialize response body, i.e. cannot read response body
* or the Content-Type of the response is not supported.
*/
@SuppressWarnings("unchecked")
public <T> T deserialize(Response response, Type returnType) throws ApiException {
if (response == null || returnType == null) {
return null;
@@ -984,6 +985,7 @@ public class ApiClient {
* @param returnType Return type
* @param callback ApiCallback
*/
@SuppressWarnings("unchecked")
public <T> void executeAsync(Call call, final Type returnType, final ApiCallback<T> callback) {
call.enqueue(new Callback() {
@Override

View File

@@ -92,6 +92,7 @@ public class JSON {
* @param returnType The type to deserialize inot
* @return The deserialized Java object
*/
@SuppressWarnings("unchecked")
public <T> T deserialize(String body, Type returnType) {
try {
if (apiClient.isLenientOnJson()) {
@@ -287,4 +288,4 @@ class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
}
}
}
{{/java8}}
{{/java8}}