com.fasterxml.jackson.jr.retrofit2.JacksonJrResponseConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jackson-jr-retrofit2 Show documentation
Show all versions of jackson-jr-retrofit2 Show documentation
Basic provider implementation for Retrofit 2 library
package com.fasterxml.jackson.jr.retrofit2;
import com.fasterxml.jackson.jr.ob.JSON;
import okhttp3.ResponseBody;
import java.io.IOException;
import retrofit2.Converter;
public class JacksonJrResponseConverter implements Converter
{
protected final JSON _jr;
protected final Class _type;
public JacksonJrResponseConverter(JSON jr, Class t) {
_jr = jr;
_type = t;
}
@Override
public T convert(ResponseBody value) throws IOException {
return _jr.beanFrom(_type, value.bytes());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy