public static Priority getInstance ( Locale locale , String priority ) { int index = DEFAULT_PRIORITY_INDEX ; if ( priority != null ) { String [ ] priorityTypes = LocaleData . getStringArray ( locale , LocaleData . PRIORITY_TYPES ) ; for ( int loop = 0 ; loop < priorityTypes . length ; loop ++ ) { if ( priorityTypes [ loop ] . equalsIgnoreCase ( priority ) == true ) { index = loop ; break ; } } } return ( Priority . getInstance ( ( index + 1 ) * 100 ) ) ; }
This method takes the textual version of a priority and returns an appropriate instance of this class . Note that unrecognised values are treated as medium priority .