code: public static OrderBy parse(String orderBy) {
      OrderBy toReturn = new OrderBy();
      String[] orderBys = orderBy.split(",");
      for (String order : orderBys) {
        order = order.trim();
        String[] fields = order.split(":");
        Order ord = Order.ASC;
        NullOrder nullOrd = NullOrder.NULL_SMALLEST;
        if (fields.length > 1) {
          String[] qualifiers = fields[1].split("\\|");
          for (String qualifier : qualifiers) {
            qualifier = qualifier.trim();
            boolean success = false;
            try {
              ord = Order.valueOf(qualifier.toUpperCase());
              success = true;
            } catch (IllegalArgumentException e) {
            }
            try {
              nullOrd = NullOrder.valueOf(qualifier.toUpperCase());
              success = true;
            } catch (IllegalArgumentException e) {
            }
            if (!success) {
              throw new PangoolRuntimeException("Unrecognised sort qualifier " + qualifier +
                  " on sorting string: " + orderBy + ". Valid qualifiers are " + validQualifiers());
            }
          }
        }
        toReturn.add(fields[0].trim(), ord, nullOrd);
      }
      return toReturn;
    }
docs: Parse in the form "field1:asc, field2:desc,...,fieldn:asc|null_smallest"
  <br/>
  Examples:
  <br/>
  "f1,f2,f3"
  <br/>
  "f1:asc,f2:desc,f3"
  <br/>
  "f1,f2:asc|null_smallest,f3:desc|null_biggest"