All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.wandersnail.common.http.factory.FastJsonConverterFactory Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show newest version
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 requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, Retrofit retrofit) {
        return super.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy