public ThreadFactoryBuilder setPriority ( int priority ) { // Thread#setPriority() already checks for validity. These error messages // are nicer though and will fail-fast. checkArgument ( priority >= Thread . MIN_PRIORITY , "Thread priority (%s) must be >= %s" , priority , Thread . MIN_PRIORITY ) ; checkArgument ( priority <= Thread . MAX_PRIORITY , "Thread priority (%s) must be <= %s" , priority , Thread . MAX_PRIORITY ) ; this . priority = priority ; return this ; }
Sets the priority for new threads created with this ThreadFactory .