com.univapay.sdk.converters.BinaryDataConverterFactory Maven / Gradle / Ivy
The newest version!
package com.univapay.sdk.converters;
import com.univapay.sdk.models.response.UnivapayBinaryData;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import okhttp3.ResponseBody;
import org.jetbrains.annotations.Nullable;
import retrofit2.Converter;
import retrofit2.Retrofit;
public class BinaryDataConverterFactory extends Converter.Factory {
@Nullable
@Override
public Converter responseBodyConverter(
Type type, Annotation[] annotations, Retrofit retrofit) {
if (type.equals(UnivapayBinaryData.class)) {
return (Converter)
responseBody -> new UnivapayBinaryData(responseBody.bytes());
} else return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy