Class ImmutableThreadFactoryProvider
java.lang.Object
org.opendaylight.yangtools.util.concurrent.ThreadFactoryProvider
org.opendaylight.yangtools.util.concurrent.ImmutableThreadFactoryProvider
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableThreadFactoryProvider
extends ThreadFactoryProvider
Immutable implementation of
ThreadFactoryProvider
.
Use the builder to create immutable instances:
ImmutableThreadFactoryProvider.builder()
.
Use the static factory method to create immutable instances:
ImmutableThreadFactoryProvider.of()
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableThreadFactoryProvider
.static interface
static interface
static interface
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableThreadFactoryProvider
.copyOf
(ThreadFactoryProvider instance) Creates an immutable copy of aThreadFactoryProvider
value.boolean
daemon()
Daemon or not for new threads created via this factory.boolean
This instance is equal to all instances ofImmutableThreadFactoryProvider
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:namePrefix
,logger
,priority
,daemon
.logger()
Logger used to log uncaught exceptions from new threads created via this factory.Prefix for threads from this factory.Construct a new immutableThreadFactoryProvider
instance.priority()
Priority for new threads from this factory.toString()
Prints the immutable valueThreadFactoryProvider
with attribute values.withDaemon
(boolean value) Copy the current immutable object by setting a value for thedaemon
attribute.withLogger
(Logger value) Copy the current immutable object by setting a value for thelogger
attribute.withNamePrefix
(String value) Copy the current immutable object by setting a value for thenamePrefix
attribute.withPriority
(int value) Copy the current immutable object by setting a present value for the optionalpriority
attribute.withPriority
(Optional<Integer> optional) Copy the current immutable object by setting an optional value for thepriority
attribute.Methods inherited from class org.opendaylight.yangtools.util.concurrent.ThreadFactoryProvider
get
-
Method Details
-
namePrefix
Prefix for threads from this factory. For example, "rpc-pool", to create "rpc-pool-1/2/3" named threads. Note that this is a prefix, not a format, so you pass just "rpc-pool" instead of e.g. "rpc-pool-%d".- Specified by:
namePrefix
in classThreadFactoryProvider
-
logger
Logger used to log uncaught exceptions from new threads created via this factory.- Specified by:
logger
in classThreadFactoryProvider
-
priority
Priority for new threads from this factory.- Specified by:
priority
in classThreadFactoryProvider
-
daemon
public boolean daemon()Daemon or not for new threads created via this factory. NB: Defaults to true.- Overrides:
daemon
in classThreadFactoryProvider
-
withNamePrefix
Copy the current immutable object by setting a value for thenamePrefix
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for namePrefix- Returns:
- A modified copy of the
this
object
-
withLogger
Copy the current immutable object by setting a value for thelogger
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for logger- Returns:
- A modified copy of the
this
object
-
withPriority
Copy the current immutable object by setting a present value for the optionalpriority
attribute.- Parameters:
value
- The value for priority- Returns:
- A modified copy of
this
object
-
withPriority
Copy the current immutable object by setting an optional value for thepriority
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for priority- Returns:
- A modified copy of
this
object
-
withDaemon
Copy the current immutable object by setting a value for thedaemon
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for daemon- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableThreadFactoryProvider
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:namePrefix
,logger
,priority
,daemon
. -
toString
Prints the immutable valueThreadFactoryProvider
with attribute values. -
of
public static ImmutableThreadFactoryProvider of(String namePrefix, Logger logger, Optional<Integer> priority) Construct a new immutableThreadFactoryProvider
instance.- Parameters:
namePrefix
- The value for thenamePrefix
attributelogger
- The value for thelogger
attributepriority
- The value for thepriority
attribute- Returns:
- An immutable ThreadFactoryProvider instance
-
copyOf
Creates an immutable copy of aThreadFactoryProvider
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable ThreadFactoryProvider instance
-
builder
Creates a builder forImmutableThreadFactoryProvider
.ImmutableThreadFactoryProvider.builder() .namePrefix(String) // required
namePrefix
.logger(org.slf4j.Logger) // requiredlogger
.priority(Integer) // optionalpriority
.daemon(boolean) // optionaldaemon
.build();- Returns:
- A new ImmutableThreadFactoryProvider builder
-