fix Java 8 compilation!!!
This commit is contained in:
parent
33952a1795
commit
9e1e979855
1 changed files with 43 additions and 37 deletions
|
@ -33,50 +33,56 @@ public class RestCallPageSupplier<T> implements PageSupplier<T> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> newBuilder() {
|
public Builder<T> newBuilder() {
|
||||||
final RestCall<Page<T>>.RestCallBuilder restCallBuilder = this.restCall.newBuilder();
|
return new RestCallBuilderAdapter<>(this.restCall.newBuilder());
|
||||||
final Builder<T> builer = new Builder<>() {
|
}
|
||||||
@Override
|
|
||||||
public Builder<T> withPaging(final int pageNumber, final int pageSize) {
|
|
||||||
restCallBuilder.withPaging(pageNumber, pageSize);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public static final class RestCallBuilderAdapter<T> implements Builder<T> {
|
||||||
public Builder<T> withSorting(final String column, final PageSortOrder order) {
|
|
||||||
restCallBuilder.withSorting(column, order);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
final RestCall<Page<T>>.RestCallBuilder restCallBuilder;
|
||||||
public Builder<T> withQueryParams(final MultiValueMap<String, String> params) {
|
|
||||||
restCallBuilder.withQueryParams(params);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
private RestCallBuilderAdapter(final RestCall<Page<T>>.RestCallBuilder restCallBuilder) {
|
||||||
public Builder<T> withQueryParam(final String name, final String value) {
|
this.restCallBuilder = restCallBuilder;
|
||||||
restCallBuilder.withQueryParam(name, value);
|
}
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> withURIVariable(final String name, final String id) {
|
public Builder<T> withPaging(final int pageNumber, final int pageSize) {
|
||||||
restCallBuilder.withURIVariable(name, id);
|
this.restCallBuilder.withPaging(pageNumber, pageSize);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> apply(final Function<Builder<T>, Builder<T>> f) {
|
public Builder<T> withSorting(final String column, final PageSortOrder order) {
|
||||||
return f.apply(this);
|
this.restCallBuilder.withSorting(column, order);
|
||||||
}
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<Page<T>> getPage() {
|
public Builder<T> withQueryParams(final MultiValueMap<String, String> params) {
|
||||||
return restCallBuilder.call();
|
this.restCallBuilder.withQueryParams(params);
|
||||||
}
|
return this;
|
||||||
};
|
}
|
||||||
|
|
||||||
return builer;
|
@Override
|
||||||
|
public Builder<T> withQueryParam(final String name, final String value) {
|
||||||
|
this.restCallBuilder.withQueryParam(name, value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Builder<T> withURIVariable(final String name, final String id) {
|
||||||
|
this.restCallBuilder.withURIVariable(name, id);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Builder<T> apply(final Function<Builder<T>, Builder<T>> f) {
|
||||||
|
return f.apply(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<Page<T>> getPage() {
|
||||||
|
return this.restCallBuilder.call();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue