public void configurePriorities(final String[] priorities) {
        // Set the non defined state in the property at 0 priority
        // Enumeration of existing state
        int priority;
        // Get the custom priority
        for (final String state : priorities) {
            // count the token separated by ","
            final StringTokenizer tmpPriorityTokens = new StringTokenizer(state.trim(), ",");
            if (tmpPriorityTokens.countTokens() == 2) {
                // To avoid the the pb of case
                final String tmpState = tmpPriorityTokens.nextToken().trim().toUpperCase();
                // If the custom state exist
                if (StateUtilities.isStateExist(tmpState)) {
                    try {
                        priority = Integer.valueOf(tmpPriorityTokens.nextToken().trim());
                    } catch (final NumberFormatException e) {
                        priority = 0;
                    }
                    putStatePriority(StateUtilities.getStateForName(tmpState), priority);
                }
            }
        }
    }
public void configurePriorities ( final String [ ] priorities ) { int priority ; for ( final String state : priorities ) { final StringTokenizer tmpPriorityTokens = new StringTokenizer ( state . trim ( ) , "," ) ; if ( tmpPriorityTokens . countTokens ( ) == 2 ) { final String tmpState = tmpPriorityTokens . nextToken ( ) . trim ( ) . toUpperCase ( ) ; if ( StateUtilities . isStateExist ( tmpState ) ) { try { priority = Integer . valueOf ( tmpPriorityTokens . nextToken ( ) . trim ( ) ) ; } catch ( final NumberFormatException e ) { priority = 0 ; } putStatePriority ( StateUtilities . getStateForName ( tmpState ) , priority ) ; } } } }
Configure the state priorities

@param priorities
array of String. eg, STATE,priorityValue