Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
minor refactore
Browse files Browse the repository at this point in the history
  • Loading branch information
jawidMuhammadi committed Jun 1, 2020
1 parent efd23e8 commit 742ddf8
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.apache.fineract.data.remote;

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

Expand All @@ -15,12 +14,9 @@ public class NullOnEmptyConverterFactory extends Converter.Factory {
Retrofit retrofit) {
final Converter<ResponseBody, ?> delegate = retrofit.nextResponseBodyConverter(this, type,
annotations);
return new Converter<ResponseBody, Object>() {
@Override
public Object convert(ResponseBody body) throws IOException {
if (body.contentLength() == 0) return null;
return delegate.convert(body);
}
return (Converter<ResponseBody, Object>) body -> {
if (body.contentLength() == 0) return null;
return delegate.convert(body);
};
}
}

0 comments on commit 742ddf8

Please sign in to comment.