Class CheckedCacheConfigBuilder<K,V,E extends Exception>
- java.lang.Object
-
- org.opendaylight.infrautils.caches.CheckedCacheConfigBuilder<K,V,E>
-
@Generated("org.immutables.processor.ProxyProcessor") public final class CheckedCacheConfigBuilder<K,V,E extends Exception> extends Object
Builds instances of typeCheckedCacheConfig
. Initialize attributes and then invoke thebuild()
method to create an immutable instance.CheckedCacheConfigBuilder
is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Constructor Summary
Constructors Constructor Description CheckedCacheConfigBuilder()
Creates a builder forCheckedCacheConfig
instances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CheckedCacheConfigBuilder<K,V,E>
anchor(Object anchor)
Initializes the value for theanchor
attribute.CheckedCacheConfig<K,V,E>
build()
Builds a newCheckedCacheConfig
.CheckedCacheConfigBuilder<K,V,E>
cacheFunction(CheckedCacheFunction<K,V,E> cacheFunction)
Initializes the value for thecacheFunction
attribute.CheckedCacheConfigBuilder<K,V,E>
description(String description)
Initializes the value for thedescription
attribute.CheckedCacheConfigBuilder<K,V,E>
id(String id)
Initializes the value for theid
attribute.
-
-
-
Constructor Detail
-
CheckedCacheConfigBuilder
public CheckedCacheConfigBuilder()
Creates a builder forCheckedCacheConfig
instances.new CheckedCacheConfigBuilder<K, V, E>() .anchor(Object) // required
anchor
.id(String) // optionalid
.description(String) // optionaldescription
.cacheFunction(org.opendaylight.infrautils.caches.CheckedCacheFunction<K, V, E>) // requiredcacheFunction
.build();
-
-
Method Detail
-
anchor
@CanIgnoreReturnValue public final CheckedCacheConfigBuilder<K,V,E> anchor(Object anchor)
Initializes the value for theanchor
attribute.- Parameters:
anchor
- The value for anchor- Returns:
this
builder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final CheckedCacheConfigBuilder<K,V,E> id(String id)
Initializes the value for theid
attribute.If not set, this attribute will have a default value as returned by the initializer of
id
.- Parameters:
id
- The value for id- Returns:
this
builder for use in a chained invocation
-
description
@CanIgnoreReturnValue public final CheckedCacheConfigBuilder<K,V,E> description(String description)
Initializes the value for thedescription
attribute.If not set, this attribute will have a default value as returned by the initializer of
description
.- Parameters:
description
- The value for description- Returns:
this
builder for use in a chained invocation
-
cacheFunction
@CanIgnoreReturnValue public final CheckedCacheConfigBuilder<K,V,E> cacheFunction(CheckedCacheFunction<K,V,E> cacheFunction)
Initializes the value for thecacheFunction
attribute.- Parameters:
cacheFunction
- The value for cacheFunction- Returns:
this
builder for use in a chained invocation
-
build
public CheckedCacheConfig<K,V,E> build()
Builds a newCheckedCacheConfig
.- Returns:
- An immutable instance of CheckedCacheConfig
- Throws:
IllegalStateException
- if any required attributes are missing
-
-