public final String getRangesAsString ( final Status status ) { List < String > ranges = new ArrayList < String > ( ) ; List < Range > rangeList ; switch ( status ) { case OK : rangeList = okThresholdList ; break ; case WARNING : rangeList = warningThresholdList ; break ; case CRITICAL : default : rangeList = criticalThresholdList ; break ; } for ( Range r : rangeList ) { ranges . add ( r . getRangeString ( ) ) ; } if ( ranges . isEmpty ( ) ) { return null ; } return StringUtils . join ( ranges , "," ) ; }
Returns the requested range list as comma separated string .