use of org.jboss.pnc.datastore.limits.rsql.EmptySortInfo in project pnc by project-ncl.
the class RSQLProducerImpl method getSortInfo.
@Override
public <DB extends GenericEntity<?>> SortInfo getSortInfo(Class<DB> type, String rsql) {
if (rsql == null || rsql.isEmpty()) {
return new EmptySortInfo();
}
if (!rsql.startsWith(FIXED_START_OF_SORTING_EXPRESSION)) {
rsql = FIXED_START_OF_SORTING_EXPRESSION + rsql;
}
Node rootNode = sortParser.parse(preprocessRSQL(rsql));
Function<RSQLSelectorPath, String> toPath = (RSQLSelectorPath selector) -> mapper.toPath(type, selector);
return (SortInfo) rootNode.accept(new SortRSQLNodeTraveller(toPath));
}
Aggregations