Last active
December 6, 2016 00:44
-
-
Save oldergod/1c20fde0787afe8840cc108a6abf902b to your computer and use it in GitHub Desktop.
Revisions
-
oldergod revised this gist
Dec 6, 2016 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,9 @@ public class LoginContextUnwrappingConverter extends Converter.Factory { } final Converter<ResponseBody, LoginResponse> delegate = retrofit.nextResponseBodyConverter(this, LoginResponse.class, annotations); return body -> { LoginResponse wrapper = delegate.convert(body); -
oldergod created this gist
Dec 6, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ 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(); }; } }