public ArrayList < SchemaField > getSchema ( ) { final ArrayList < SchemaField > items = new ArrayList < SchemaField > ( schemaFields . values ( ) ) ; Collections . sort ( items , new Comparator < SchemaField > ( ) { @ Override public int compare ( final SchemaField left , final SchemaField right ) { return left . getId ( ) - right . getId ( ) ; } } ) ; return items ; }
Get the schema as a collection of fields . We guarantee the ordering by field id .