StringUtils.isEmpty(orderParameter) ? DEFAULT_ORDER_DIR : orderParameter.substring(
orderParameter.indexOf(ORDER_MARKER) + 1, orderParameter.length());
final boolean orderAsc = Arrays.asList(ASC_ORDER_DIR).contains(orderDir);
if (orderGetter.equals(REQUEST_NUMBER_YEAR)) {
return orderAsc ? AcademicServiceRequest.COMPARATOR_BY_NUMBER : new ReverseComparator(
AcademicServiceRequest.COMPARATOR_BY_NUMBER);
} else if (orderGetter.equals(EXECUTION_YEAR)) {
return orderAsc ? AcademicServiceRequest.EXECUTION_YEAR_AND_OID_COMPARATOR : new ReverseComparator(
AcademicServiceRequest.EXECUTION_YEAR_AND_OID_COMPARATOR);
} else if (orderGetter.equals(REGISTRATION_NUMBER) || orderGetter.equals(DESCRIPTION)
|| orderGetter.equals(URGENT_REQUEST) || orderGetter.equals(REGISTRATION_NUMBER)
|| orderGetter.equals(REQUEST_DATE) || orderGetter.equals(ACTIVE_SITUATION_DATE)) {
final ComparatorChain chain = new ComparatorChain();
chain.addComparator(orderAsc ? new BeanComparator(orderGetter) : new ReverseComparator(
new BeanComparator(orderGetter)));
chain.addComparator(DomainObjectUtil.COMPARATOR_BY_ID);
return chain;
}