code: public static Sort.Order toSortOrder(ComparatorItem comparatorItem) {
      if (comparatorItem == null || comparatorItem.getField() == null
          || comparatorItem.getField().trim().length() == 0) {
        return null;
      }
      Sort.Direction direction = comparatorItem.isAsc() ? Sort.Direction.ASC : Sort.Direction.DESC;
      Sort.NullHandling nullHandlingHint =
          comparatorItem.isNullIsFirst() ? Sort.NullHandling.NULLS_FIRST
              : Sort.NullHandling.NULLS_LAST;
      Sort.Order order = new Sort.Order(direction, comparatorItem.getField(), nullHandlingHint);
      if (comparatorItem.isIgnoreCase()) {
        return order.ignoreCase();
      }
      return order;
    }
docs: Transforms the comparator item into a {@code Sort.Order} object.
  
  @param comparatorItem the comparator item
  @return the sort object