code: public static SortKey[] keys (BagArray keys) {
          SortKey[] sortKeys = new SortKey[keys.getCount ()];
          for (int i = 0, end = keys.getCount (); i < end; ++i) {
              sortKeys[i] = new SortKey (keys.getBagObject (i));
          }
          return sortKeys;
      }
docs: array of sort keys like [ { "key":"key1" }, { "key":"key2", "type":"alphabetic"}, { "key":"key2", "type":"numeric", "order":"ascending"} ]