Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LoginContextUnwrappingConverter extends Converter.Factory {
- @Override
- public Converter<ResponseBody, LoginContext>
- responseBodyConverter(Type type,
- Annotation[] annotations,
- Retrofit retrofit) {
- if (type != LoginContext.class) {
- return null;
- }
- final Converter<ResponseBody, LoginResponse> delegate =
- retrofit.nextResponseBodyConverter(this,
- LoginResponse.class,
- annotations);
- return body -> {
- LoginResponse wrapper = delegate.convert(body);
- return wrapper.context();
- };
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement