return null;
} else if (sorting.getComparator() == null) {
return new Comparator<PortalConfig>() {
@Override
public int compare(PortalConfig o1, PortalConfig o2) {
Site site = new SiteImpl(o1);
Site other = new SiteImpl(o2);
if (sorting.getOrder() == Sorting.Order.descending) {
Site tmp = site;
site = other;
other = tmp;
}
return site.compareTo(other);
}
};
} else {
return new ComparatorWrapper<Site, PortalConfig>(sorting.getComparator()) {
@Override
protected Site from(PortalConfig entity) {
return new SiteImpl(entity);
}
};
}
}