Class BasicThreadFactory.Builder
java.lang.Object
org.apache.commons.lang3.concurrent.BasicThreadFactory.Builder
- All Implemented Interfaces:
- Builder<BasicThreadFactory>
- Enclosing class:
- BasicThreadFactory
public static class BasicThreadFactory.Builder
extends Object
implements Builder<BasicThreadFactory>
A builder class for creating instances of 
 BasicThreadFactory.
 
 Using this builder class instances of BasicThreadFactory can be
 created and initialized. The class provides methods that correspond to
 the configuration options supported by BasicThreadFactory. Method
 chaining is supported. Refer to the documentation of 
 BasicThreadFactory for a usage example.
 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbuild()Creates a newBasicThreadFactorywith all configuration options that have been specified by calling methods on this builder.daemon(boolean daemon) Sets the daemon flag for the newBasicThreadFactory.namingPattern(String namingPattern) Sets the naming pattern to be used by the newBasicThreadFactory.priority(int priority) Sets the priority for the threads created by the newBasicThreadFactory.voidreset()Resets this builder.uncaughtExceptionHandler(Thread.UncaughtExceptionHandler exceptionHandler) Sets the uncaught exception handler for the threads created by the newBasicThreadFactory.wrappedFactory(ThreadFactory factory) Sets theThreadFactoryto be wrapped by the newBasicThreadFactory.
- 
Constructor Details- 
Builderpublic Builder()Constructs a new instance.
 
- 
- 
Method Details- 
buildCreates a newBasicThreadFactorywith all configuration options that have been specified by calling methods on this builder. After creating the factoryreset()is called.- Specified by:
- buildin interface- Builder<BasicThreadFactory>
- Returns:
- the new BasicThreadFactory
 
- 
daemonSets the daemon flag for the newBasicThreadFactory. If this flag is set to true the new thread factory will create daemon threads.- Parameters:
- daemon- the value of the daemon flag
- Returns:
- a reference to this BasicThreadFactory.Builder
 
- 
namingPatternSets the naming pattern to be used by the newBasicThreadFactory.- Parameters:
- namingPattern- the naming pattern (must not be null)
- Returns:
- a reference to this BasicThreadFactory.Builder
- Throws:
- NullPointerException- if the naming pattern is null
 
- 
prioritySets the priority for the threads created by the newBasicThreadFactory.- Parameters:
- priority- the priority
- Returns:
- a reference to this BasicThreadFactory.Builder
 
- 
resetResets this builder. All configuration options are set to default values. Note: If thebuild()method was called, it is not necessary to callreset()explicitly because this is done automatically.
- 
uncaughtExceptionHandlerpublic BasicThreadFactory.Builder uncaughtExceptionHandler(Thread.UncaughtExceptionHandler exceptionHandler) Sets the uncaught exception handler for the threads created by the newBasicThreadFactory.- Parameters:
- exceptionHandler- the- Thread.UncaughtExceptionHandler(must not be null)
- Returns:
- a reference to this BasicThreadFactory.Builder
- Throws:
- NullPointerException- if the exception handler is null
 
- 
wrappedFactorySets theThreadFactoryto be wrapped by the newBasicThreadFactory.- Parameters:
- factory- the wrapped- ThreadFactory(must not be null)
- Returns:
- a reference to this BasicThreadFactory.Builder
- Throws:
- NullPointerException- if the passed in- ThreadFactoryis null
 
 
-