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 classBuilds instances of typeImmutableThreadFactoryProvider.static interfacestatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableThreadFactoryProvider.copyOf(ThreadFactoryProvider instance) Creates an immutable copy of aThreadFactoryProvidervalue.booleandaemon()Daemon or not for new threads created via this factory.booleanThis instance is equal to all instances ofImmutableThreadFactoryProviderthat have equal attribute values.inthashCode()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 immutableThreadFactoryProviderinstance.priority()Priority for new threads from this factory.toString()Prints the immutable valueThreadFactoryProviderwith attribute values.withDaemon(boolean value) Copy the current immutable object by setting a value for thedaemonattribute.withLogger(Logger value) Copy the current immutable object by setting a value for theloggerattribute.withNamePrefix(String value) Copy the current immutable object by setting a value for thenamePrefixattribute.withPriority(int value) Copy the current immutable object by setting a present value for the optionalpriorityattribute.withPriority(Optional<Integer> optional) Copy the current immutable object by setting an optional value for thepriorityattribute.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:
namePrefixin classThreadFactoryProvider
-
logger
Logger used to log uncaught exceptions from new threads created via this factory.- Specified by:
loggerin classThreadFactoryProvider
-
priority
Priority for new threads from this factory.- Specified by:
priorityin classThreadFactoryProvider
-
daemon
public boolean daemon()Daemon or not for new threads created via this factory. NB: Defaults to true.- Overrides:
daemonin classThreadFactoryProvider
-
withNamePrefix
Copy the current immutable object by setting a value for thenamePrefixattribute. 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
thisobject
-
withLogger
Copy the current immutable object by setting a value for theloggerattribute. 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
thisobject
-
withPriority
Copy the current immutable object by setting a present value for the optionalpriorityattribute.- Parameters:
value- The value for priority- Returns:
- A modified copy of
thisobject
-
withPriority
Copy the current immutable object by setting an optional value for thepriorityattribute. 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
thisobject
-
withDaemon
Copy the current immutable object by setting a value for thedaemonattribute. 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
thisobject
-
equals
This instance is equal to all instances ofImmutableThreadFactoryProviderthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:namePrefix,logger,priority,daemon. -
toString
Prints the immutable valueThreadFactoryProviderwith attribute values. -
of
public static ImmutableThreadFactoryProvider of(String namePrefix, Logger logger, Optional<Integer> priority) Construct a new immutableThreadFactoryProviderinstance.- Parameters:
namePrefix- The value for thenamePrefixattributelogger- The value for theloggerattributepriority- The value for thepriorityattribute- Returns:
- An immutable ThreadFactoryProvider instance
-
copyOf
Creates an immutable copy of aThreadFactoryProvidervalue. 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) // requirednamePrefix.logger(org.slf4j.Logger) // requiredlogger.priority(Integer) // optionalpriority.daemon(boolean) // optionaldaemon.build();- Returns:
- A new ImmutableThreadFactoryProvider builder
-