|
|
|
@ -55,10 +55,10 @@ public class ThreadFactoryBuilder implements Builder<ThreadFactory> {
|
|
|
|
|
|
|
|
|
|
public ThreadFactoryBuilder priority(int priority) {
|
|
|
|
|
if (priority < Thread.MIN_PRIORITY) {
|
|
|
|
|
throw new IllegalArgumentException(String.format("Thread priority ({}) must be >= {}", priority, Thread.MIN_PRIORITY));
|
|
|
|
|
throw new IllegalArgumentException(String.format("Thread priority (%s) must be >= %s", priority, Thread.MIN_PRIORITY));
|
|
|
|
|
}
|
|
|
|
|
if (priority > Thread.MAX_PRIORITY) {
|
|
|
|
|
throw new IllegalArgumentException(String.format("Thread priority ({}) must be <= {}", priority, Thread.MAX_PRIORITY));
|
|
|
|
|
throw new IllegalArgumentException(String.format("Thread priority (%s) must be <= %s", priority, Thread.MAX_PRIORITY));
|
|
|
|
|
}
|
|
|
|
|
this.priority = priority;
|
|
|
|
|
return this;
|
|
|
|
|