private List < Filter > getFilters ( final boolean group_by ) { final int ntags = getNumTags ( ) ; final List < Filter > filters = new ArrayList < Filter > ( ntags ) ; for ( int tag = 0 ; tag < ntags ; tag ++ ) { final Filter filter = new Filter ( ) ; filter . tagk = getTagName ( tag ) ; filter . tagv = getTagValue ( tag ) ; filter . is_groupby = isTagGroupby ( tag ) ; if ( filter . tagk . isEmpty ( ) || filter . tagv . isEmpty ( ) ) { continue ; } if ( filter . is_groupby == group_by ) { filters . add ( filter ) ; } } // sort on the tagk Collections . sort ( filters ) ; return filters ; }
Helper method to extract the tags from the row set and sort them before sending to the API so that we avoid a bug wherein the sort order changes on reload .