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

com.cmonbaby.http.converter.FastJsonConverterFactory Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
package com.cmonbaby.http.converter;

import androidx.annotation.NonNull;

import java.lang.annotation.Annotation;
import java.lang.reflect.Type;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Converter;
import retrofit2.Retrofit;

/**
 * 

Author: Simon *

QO: 8950764 *

Email: [email protected] *

WebSize: https://www.cmonbaby.com *

Version: 1.0.0 *

Date: 2020/12/28 *

Description: FastJson转换类 */ public final class FastJsonConverterFactory extends Converter.Factory { public static FastJsonConverterFactory create() { return new FastJsonConverterFactory(); } /** * 需要重写父类中responseBodyConverter,该方法用来转换服务器返回数据 */ @Override public Converter responseBodyConverter(@NonNull Type type, @NonNull Annotation[] annotations, @NonNull Retrofit retrofit) { return new FastJsonResponseBodyConverter<>(type); } /** * 需要重写父类中responseBodyConverter,该方法用来转换发送给服务器的数据 */ @Override public Converter requestBodyConverter(@NonNull Type type, @NonNull Annotation[] parameterAnnotations, @NonNull Annotation[] methodAnnotations, @NonNull Retrofit retrofit) { return new FastJsonRequestBodyConverter<>(); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy