foundation.jpa.querydsl.spring.impl.SearchResultImpl Maven / Gradle / Ivy
package foundation.jpa.querydsl.spring.impl;
import com.querydsl.core.types.EntityPath;
import foundation.jpa.querydsl.spring.Search;
import foundation.jpa.querydsl.spring.SearchCriteria;
import foundation.jpa.querydsl.spring.SearchResult;
import org.springframework.data.domain.Page;
import static java.util.Objects.nonNull;
public class SearchResultImpl> implements SearchResult, Search {
private final SearchCriteria extends EntityPath> criteria;
private final Page page;
private final Throwable error;
public SearchResultImpl(SearchCriteria extends EntityPath> criteria, Page page, Throwable error) {
this.criteria = criteria;
this.page = page;
this.error = error;
}
@Override
public SearchCriteria extends EntityPath> getCriteria() {
return criteria;
}
@Override
public Page getPage() {
return page;
}
@Override
public Throwable getError() {
return error;
}
@Override
public boolean hasError() {
return nonNull(error);
}
}