Skip to content

Commit

Permalink
Merge commit '14c789805ffe68c1ced5dbe0f71448095216fcc1' into unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghaolu committed Sep 6, 2016
2 parents a55439f + 3010c5c commit 9732907
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package com.microsoft.azure;

import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceResponse;

import java.util.List;

Expand Down Expand Up @@ -71,7 +70,7 @@ public void load(List<E> result) {
}

@Override
public void success(ServiceResponse<List<E>> result) {
public void success(List<E> result) {
success();
}

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 @@ -19,7 +19,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 @@ -42,7 +42,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 @@ -69,9 +69,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 @@ -102,9 +102,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 9732907

Please sign in to comment.