Class CacheConfigBuilder<K,V>
- java.lang.Object
-
- org.opendaylight.infrautils.caches.CacheConfigBuilder<K,V>
-
@Generated("org.immutables.processor.ProxyProcessor") public final class CacheConfigBuilder<K,V> extends Object
Builds instances of typeCacheConfig
. Initialize attributes and then invoke thebuild()
method to create an immutable instance.CacheConfigBuilder
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 CacheConfigBuilder()
Creates a builder forCacheConfig
instances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CacheConfigBuilder<K,V>
anchor(Object anchor)
Initializes the value for theanchor
attribute.CacheConfig<K,V>
build()
Builds a newCacheConfig
.CacheConfigBuilder<K,V>
cacheFunction(CacheFunction<K,V> cacheFunction)
Initializes the value for thecacheFunction
attribute.CacheConfigBuilder<K,V>
description(String description)
Initializes the value for thedescription
attribute.CacheConfigBuilder<K,V>
id(String id)
Initializes the value for theid
attribute.
-
-
-
Constructor Detail
-
CacheConfigBuilder
public CacheConfigBuilder()
Creates a builder forCacheConfig
instances.new CacheConfigBuilder<K, V>() .anchor(Object) // required
anchor
.id(String) // optionalid
.description(String) // optionaldescription
.cacheFunction(org.opendaylight.infrautils.caches.CacheFunction<K, V>) // requiredcacheFunction
.build();
-
-
Method Detail
-
anchor
@CanIgnoreReturnValue public final CacheConfigBuilder<K,V> 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 CacheConfigBuilder<K,V> 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 CacheConfigBuilder<K,V> 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 CacheConfigBuilder<K,V> cacheFunction(CacheFunction<K,V> cacheFunction)
Initializes the value for thecacheFunction
attribute.- Parameters:
cacheFunction
- The value for cacheFunction- Returns:
this
builder for use in a chained invocation
-
build
public CacheConfig<K,V> build()
Builds a newCacheConfig
.- Returns:
- An immutable instance of CacheConfig
- Throws:
IllegalStateException
- if any required attributes are missing
-
-