use of com.epam.ta.reportportal.entity.filter.FilterSort in project service-api by reportportal.
the class UserFilterBuilder method addSelectionParameters.
/**
* Convert provided selection into db and add them in correct order
* to filter object
*
* @param orders Filter sorting conditions
* @return UserFilterBuilder
*/
public UserFilterBuilder addSelectionParameters(List<Order> orders) {
userFilter.getFilterSorts().clear();
ofNullable(orders).ifPresent(o -> o.forEach(order -> {
FilterSort filterSort = new FilterSort();
filterSort.setField(order.getSortingColumnName());
filterSort.setDirection(order.getIsAsc() ? Sort.Direction.ASC : Sort.Direction.DESC);
userFilter.getFilterSorts().add(filterSort);
}));
return this;
}
Aggregations