cn.wandersnail.common.http.factory.FastJsonConverterFactory Maven / Gradle / Ivy
package cn.wandersnail.common.http.factory;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import cn.wandersnail.common.http.converter.FastJsonResponseBodyConverter;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Converter;
import retrofit2.Retrofit;
/**
* date: 2019/8/23 14:35
* author: zengfansheng
*/
public class FastJsonConverterFactory extends Converter.Factory {
private FastJsonConverterFactory() {}
public static FastJsonConverterFactory create() {
return new FastJsonConverterFactory();
}
@Override
public Converter responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) {
return new FastJsonResponseBodyConverter(type);
}
@Override
public Converter, RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, Retrofit retrofit) {
return super.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit);
}
}