Skip to content

Commit

Permalink
Remove ServiceResponse<> wrappers in most methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghaolu committed Sep 6, 2016
1 parent d0191c7 commit b5aa0f4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void onNext(ServiceResponse<Page<E>> serviceResponse) {
}
}
if (behavior == ListOperationCallback.PagingBehavior.STOP || serviceResponse.getBody().getNextPageLink() == null) {
serviceCall.set(new ServiceResponse<>(lastResponse.getBody().getItems(), lastResponse.getResponse()));
serviceCall.set(lastResponse.getBody().getItems());
} else {
serviceCall.setSubscription(next.call(serviceResponse.getBody().getNextPageLink()).single().subscribe(this));
}
Expand Down
12 changes: 6 additions & 6 deletions client-runtime/src/main/java/com/microsoft/rest/ServiceCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @param <T> the type of the returning object
*/
public class ServiceCall<T> extends AbstractFuture<ServiceResponse<T>> {
public class ServiceCall<T> extends AbstractFuture<T> {
/**
* The Retrofit method invocation.
*/
Expand All @@ -43,7 +43,7 @@ public static <T> ServiceCall<T> create(final Observable<ServiceResponse<T>> obs
.subscribe(new Action1<ServiceResponse<T>>() {
@Override
public void call(ServiceResponse<T> t) {
serviceCall.set(t);
serviceCall.set(t.getBody());
}
}, new Action1<Throwable>() {
@Override
Expand All @@ -70,9 +70,9 @@ public static <T> ServiceCall<T> create(final Observable<ServiceResponse<T>> obs
@Override
public void call(ServiceResponse<T> t) {
if (callback != null) {
callback.success(t);
callback.success(t.getBody());
}
serviceCall.set(t);
serviceCall.set(t.getBody());
}
}, new Action1<Throwable>() {
@Override
Expand Down Expand Up @@ -103,9 +103,9 @@ public static <T, V> ServiceCall<T> createWithHeaders(final Observable<ServiceRe
@Override
public void call(ServiceResponse<T> t) {
if (callback != null) {
callback.success(t);
callback.success(t.getBody());
}
serviceCall.set(t);
serviceCall.set(t.getBody());
}
}, new Action1<Throwable>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public abstract class ServiceCallback<T> {
/**
* Override this method to handle successful REST call results.
*
* @param result the ServiceResponse holding the response.
* @param result the result object.
*/
public abstract void success(ServiceResponse<T> result);
public abstract void success(T result);
}

0 comments on commit b5aa0f4

Please sign in to comment.