public static Integer getThreadPriorityFromTaskPriority ( final int taskPriority ) { if ( taskPriority == 0 ) { return null ; } int finalPriority = taskPriority + Thread . NORM_PRIORITY ; if ( taskPriority > Thread . MAX_PRIORITY ) { return Thread . MAX_PRIORITY ; } if ( finalPriority < Thread . MIN_PRIORITY ) { return Thread . MIN_PRIORITY ; } return finalPriority ; }
Return the thread - factory friendly priorities from the task priority