Class ImmutableThreadFactoryProvider.Builder
- java.lang.Object
-
- org.opendaylight.infrautils.utils.concurrent.ImmutableThreadFactoryProvider.Builder
-
- All Implemented Interfaces:
ImmutableThreadFactoryProvider.BuildFinal
,ImmutableThreadFactoryProvider.LoggerBuildStage
,ImmutableThreadFactoryProvider.NamePrefixBuildStage
- Enclosing class:
- ImmutableThreadFactoryProvider
public static final class ImmutableThreadFactoryProvider.Builder extends Object implements ImmutableThreadFactoryProvider.NamePrefixBuildStage, ImmutableThreadFactoryProvider.LoggerBuildStage, ImmutableThreadFactoryProvider.BuildFinal
Builds instances of typeImmutableThreadFactoryProvider
. Initialize attributes and then invoke thebuild()
method to create an immutable instance.Builder
is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableThreadFactoryProvider
build()
Builds a newImmutableThreadFactoryProvider
.ImmutableThreadFactoryProvider.Builder
daemon(boolean daemon)
Initializes the value for thedaemon
attribute.ImmutableThreadFactoryProvider.Builder
logger(org.slf4j.Logger logger)
Initializes the value for thelogger
attribute.ImmutableThreadFactoryProvider.Builder
namePrefix(String namePrefix)
Initializes the value for thenamePrefix
attribute.ImmutableThreadFactoryProvider.Builder
priority(int priority)
Initializes the optional valuepriority
to priority.ImmutableThreadFactoryProvider.Builder
priority(Optional<Integer> priority)
Initializes the optional valuepriority
to priority.
-
-
-
Method Detail
-
namePrefix
@CanIgnoreReturnValue public final ImmutableThreadFactoryProvider.Builder namePrefix(String namePrefix)
Initializes the value for thenamePrefix
attribute.- Specified by:
namePrefix
in interfaceImmutableThreadFactoryProvider.NamePrefixBuildStage
- Parameters:
namePrefix
- The value for namePrefix- Returns:
this
builder for use in a chained invocation
-
logger
@CanIgnoreReturnValue public final ImmutableThreadFactoryProvider.Builder logger(org.slf4j.Logger logger)
Initializes the value for thelogger
attribute.- Specified by:
logger
in interfaceImmutableThreadFactoryProvider.LoggerBuildStage
- Parameters:
logger
- The value for logger- Returns:
this
builder for use in a chained invocation
-
priority
@CanIgnoreReturnValue public final ImmutableThreadFactoryProvider.Builder priority(int priority)
Initializes the optional valuepriority
to priority.- Specified by:
priority
in interfaceImmutableThreadFactoryProvider.BuildFinal
- Parameters:
priority
- The value for priority- Returns:
this
builder for chained invocation
-
priority
@CanIgnoreReturnValue public final ImmutableThreadFactoryProvider.Builder priority(Optional<Integer> priority)
Initializes the optional valuepriority
to priority.- Specified by:
priority
in interfaceImmutableThreadFactoryProvider.BuildFinal
- Parameters:
priority
- The value for priority- Returns:
this
builder for use in a chained invocation
-
daemon
@CanIgnoreReturnValue public final ImmutableThreadFactoryProvider.Builder daemon(boolean daemon)
Initializes the value for thedaemon
attribute.If not set, this attribute will have a default value as returned by the initializer of
daemon
.- Specified by:
daemon
in interfaceImmutableThreadFactoryProvider.BuildFinal
- Parameters:
daemon
- The value for daemon- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableThreadFactoryProvider build()
Builds a newImmutableThreadFactoryProvider
.- Specified by:
build
in interfaceImmutableThreadFactoryProvider.BuildFinal
- Returns:
- An immutable instance of ThreadFactoryProvider
- Throws:
IllegalStateException
- if any required attributes are missing
-
-