fix Java 8 compilation!!!

This commit is contained in:
anhefti 2020-07-14 16:41:20 +02:00
parent 33952a1795
commit 9e1e979855

View file

@ -33,35 +33,44 @@ public class RestCallPageSupplier<T> implements PageSupplier<T> {
@Override
public Builder<T> newBuilder() {
final RestCall<Page<T>>.RestCallBuilder restCallBuilder = this.restCall.newBuilder();
final Builder<T> builer = new Builder<>() {
return new RestCallBuilderAdapter<>(this.restCall.newBuilder());
}
public static final class RestCallBuilderAdapter<T> implements Builder<T> {
final RestCall<Page<T>>.RestCallBuilder restCallBuilder;
private RestCallBuilderAdapter(final RestCall<Page<T>>.RestCallBuilder restCallBuilder) {
this.restCallBuilder = restCallBuilder;
}
@Override
public Builder<T> withPaging(final int pageNumber, final int pageSize) {
restCallBuilder.withPaging(pageNumber, pageSize);
this.restCallBuilder.withPaging(pageNumber, pageSize);
return this;
}
@Override
public Builder<T> withSorting(final String column, final PageSortOrder order) {
restCallBuilder.withSorting(column, order);
this.restCallBuilder.withSorting(column, order);
return this;
}
@Override
public Builder<T> withQueryParams(final MultiValueMap<String, String> params) {
restCallBuilder.withQueryParams(params);
this.restCallBuilder.withQueryParams(params);
return this;
}
@Override
public Builder<T> withQueryParam(final String name, final String value) {
restCallBuilder.withQueryParam(name, value);
this.restCallBuilder.withQueryParam(name, value);
return this;
}
@Override
public Builder<T> withURIVariable(final String name, final String id) {
restCallBuilder.withURIVariable(name, id);
this.restCallBuilder.withURIVariable(name, id);
return this;
}
@ -72,11 +81,8 @@ public class RestCallPageSupplier<T> implements PageSupplier<T> {
@Override
public Result<Page<T>> getPage() {
return restCallBuilder.call();
return this.restCallBuilder.call();
}
};
return builer;
}
}