@Immutable public final class ImmutableThreadFactoryProvider extends ThreadFactoryProvider
ThreadFactoryProvider
.
Use the builder to create immutable instances:
ImmutableThreadFactoryProvider.builder()
.
Use the static factory method to create immutable instances:
ImmutableThreadFactoryProvider.of()
.
Modifier and Type | Class and Description |
---|---|
static class |
ImmutableThreadFactoryProvider.Builder
Builds instances of type
ImmutableThreadFactoryProvider . |
static interface |
ImmutableThreadFactoryProvider.BuildFinal |
static interface |
ImmutableThreadFactoryProvider.LoggerBuildStage |
static interface |
ImmutableThreadFactoryProvider.NamePrefixBuildStage |
Modifier and Type | Method and Description |
---|---|
static ImmutableThreadFactoryProvider.NamePrefixBuildStage |
builder()
Creates a builder for
ImmutableThreadFactoryProvider . |
static ImmutableThreadFactoryProvider |
copyOf(ThreadFactoryProvider instance)
Creates an immutable copy of a
ThreadFactoryProvider value. |
boolean |
daemon()
Daemon or not for new threads created via this factory.
|
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableThreadFactoryProvider that have equal attribute values. |
int |
hashCode()
Computes a hash code from attributes:
namePrefix , logger , priority , daemon . |
org.slf4j.Logger |
logger()
Logger used to log uncaught exceptions from new threads created via this factory.
|
String |
namePrefix()
Prefix for threads from this factory.
|
static ImmutableThreadFactoryProvider |
of(String namePrefix,
org.slf4j.Logger logger,
Optional<Integer> priority)
Construct a new immutable
ThreadFactoryProvider instance. |
Optional<Integer> |
priority()
Priority for new threads from this factory.
|
String |
toString()
Prints the immutable value
ThreadFactoryProvider with attribute values. |
ImmutableThreadFactoryProvider |
withDaemon(boolean value)
Copy the current immutable object by setting a value for the
daemon attribute. |
ImmutableThreadFactoryProvider |
withLogger(org.slf4j.Logger value)
Copy the current immutable object by setting a value for the
logger attribute. |
ImmutableThreadFactoryProvider |
withNamePrefix(String value)
Copy the current immutable object by setting a value for the
namePrefix attribute. |
ImmutableThreadFactoryProvider |
withPriority(int value)
Copy the current immutable object by setting a present value for the optional
priority attribute. |
ImmutableThreadFactoryProvider |
withPriority(Optional<Integer> optional)
Copy the current immutable object by setting an optional value for the
priority attribute. |
get
public String namePrefix()
namePrefix
in class ThreadFactoryProvider
public org.slf4j.Logger logger()
logger
in class ThreadFactoryProvider
public Optional<Integer> priority()
priority
in class ThreadFactoryProvider
public boolean daemon()
daemon
in class ThreadFactoryProvider
public final ImmutableThreadFactoryProvider withNamePrefix(String value)
namePrefix
attribute.
An equals check used to prevent copying of the same value by returning this
.value
- A new value for namePrefixthis
objectpublic final ImmutableThreadFactoryProvider withLogger(org.slf4j.Logger value)
logger
attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this
.value
- A new value for loggerthis
objectpublic final ImmutableThreadFactoryProvider withPriority(int value)
priority
attribute.value
- The value for prioritythis
objectpublic final ImmutableThreadFactoryProvider withPriority(Optional<Integer> optional)
priority
attribute.
An equality check is used on inner nullable value to prevent copying of the same value by returning this
.optional
- A value for prioritythis
objectpublic final ImmutableThreadFactoryProvider withDaemon(boolean value)
daemon
attribute.
A value equality check is used to prevent copying of the same value by returning this
.value
- A new value for daemonthis
objectpublic boolean equals(Object another)
ImmutableThreadFactoryProvider
that have equal attribute values.public int hashCode()
namePrefix
, logger
, priority
, daemon
.public String toString()
ThreadFactoryProvider
with attribute values.public static ImmutableThreadFactoryProvider of(String namePrefix, org.slf4j.Logger logger, Optional<Integer> priority)
ThreadFactoryProvider
instance.namePrefix
- The value for the namePrefix
attributelogger
- The value for the logger
attributepriority
- The value for the priority
attributepublic static ImmutableThreadFactoryProvider copyOf(ThreadFactoryProvider instance)
ThreadFactoryProvider
value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.instance
- The instance to copypublic static ImmutableThreadFactoryProvider.NamePrefixBuildStage builder()
ImmutableThreadFactoryProvider
.Copyright © 2019 OpenDaylight. All rights reserved.