/** * Construct a row for insertion. This is used by the remote client (ODK Tables) to construct a * REST request to insert the row. * * @param rowId * @param values */ public static Row forInsert( String rowId, String formId, String locale, String savepointType, String savepointTimestamp, String savepointCreator, RowFilterScope filterScope, ArrayList<DataKeyValue> values) { Row row = new Row(); row.rowId = rowId; row.formId = formId; row.locale = locale; row.savepointType = savepointType; row.savepointTimestamp = savepointTimestamp; row.savepointCreator = savepointCreator; row.rowFilterScope = filterScope; if (values == null) { row.orderedColumns = new ArrayList<DataKeyValue>(); } else { Collections.sort( values, new Comparator<DataKeyValue>() { @Override public int compare(DataKeyValue arg0, DataKeyValue arg1) { return arg0.column.compareTo(arg1.column); } }); row.orderedColumns = values; } return row; }