public TableColumnOrdering convertTableColumnOrdering(final String tableIdentifier, final String json) {
        final String[] split = this.splitColumns(json);

        final List<Ordering> orderings = new ArrayList<>();

        for (String column : split) {
            final String[] attribute = this.splitAttributes(column);
            final String identifier = attribute[0].split(":")[1];
            final String position = attribute[1].split(":")[1];

            orderings.add(new Ordering(identifier, Integer.valueOf(position)));
        }

        Collections.sort(orderings, new Comparator<Ordering>() {
            @Override
            public int compare(Ordering o1, Ordering o2) {
                return o1.getIndex().compareTo(o2.getIndex());
            }
        });

        final List<String> columnIdentifier = new ArrayList<>();

        for (Ordering ordering : orderings) {
            columnIdentifier.add(ordering.getIdentifier());
        }

        return new TableColumnOrdering(tableIdentifier, columnIdentifier);
    }
public TableColumnOrdering convertTableColumnOrdering ( final String tableIdentifier , final String json ) { final String [ ] split = this . splitColumns ( json ) ; final List < Ordering > orderings = new ArrayList < > ( ) ; for ( String column : split ) { final String [ ] attribute = this . splitAttributes ( column ) ; final String identifier = attribute [ 0 ] . split ( ":" ) [ 1 ] ; final String position = attribute [ 1 ] . split ( ":" ) [ 1 ] ; orderings . add ( new Ordering ( identifier , Integer . valueOf ( position ) ) ) ; } Collections . sort ( orderings , new Comparator < Ordering > ( ) { @ Override public int compare ( Ordering o1 , Ordering o2 ) { return o1 . getIndex ( ) . compareTo ( o2 . getIndex ( ) ) ; } } ) ; final List < String > columnIdentifier = new ArrayList < > ( ) ; for ( Ordering ordering : orderings ) { columnIdentifier . add ( ordering . getIdentifier ( ) ) ; } return new TableColumnOrdering ( tableIdentifier , columnIdentifier ) ; }
Converts given json string to {@link TableColumnOrdering} used by {@link TableColumnOrderingModel}.

@param tableIdentifier an application unique table identifier.
@param json            string to convert to {@link TableColumnOrdering}.
@return the converted {@link TableColumnOrdering}.