private void populateStats ( final StatDecoratorBean statDecoratorBean , final List < StatLineAO > allStatLines , final StatBeanSortType sortType ) { if ( allStatLines == null || allStatLines . isEmpty ( ) ) { LOGGER . warn ( "Producer's stats are empty" ) ; return ; } final int cumulatedIndex = getCumulatedIndex ( allStatLines ) ; // stats int allStatLinesSize = allStatLines . size ( ) ; final List < StatBean > statBeans = new ArrayList <> ( allStatLinesSize ) ; for ( int i = 0 ; i < allStatLinesSize ; i ++ ) { if ( i == cumulatedIndex ) continue ; final StatLineAO line = allStatLines . get ( i ) ; final List < StatValueAO > statValues = line . getValues ( ) ; final StatBean statBean = new StatBean ( ) ; statBean . setName ( line . getStatName ( ) ) ; statBean . setValues ( statValues ) ; statBeans . add ( statBean ) ; } // sort stat beans StaticQuickSorter . sort ( statBeans , sortType ) ; // set stats statDecoratorBean . setStats ( statBeans ) ; }
Allows to set all stats to decorator except cumulated stat . Stats will be sorted using given sort type .