Class CachePolicyBuilder
- java.lang.Object
-
- org.opendaylight.infrautils.caches.CachePolicyBuilder
-
@Generated("org.immutables.processor.ProxyProcessor") public final class CachePolicyBuilder extends Object
Builds instances of typeCachePolicy. Initialize attributes and then invoke thebuild()method to create an immutable instance.CachePolicyBuilderis 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 CachePolicyBuilder()Creates a builder forCachePolicyinstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CachePolicybuild()Builds a newCachePolicy.CachePolicyBuilderfrom(CachePolicy instance)Fill a builder with attribute values from the providedCachePolicyinstance.CachePolicyBuildermaxEntries(long maxEntries)Initializes the value for themaxEntriesattribute.CachePolicyBuilderstatsEnabled(boolean statsEnabled)Initializes the value for thestatsEnabledattribute.
-
-
-
Constructor Detail
-
CachePolicyBuilder
public CachePolicyBuilder()
Creates a builder forCachePolicyinstances.new CachePolicyBuilder() .statsEnabled(boolean) // optionalstatsEnabled.maxEntries(long) // optionalmaxEntries.build();
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final CachePolicyBuilder from(CachePolicy instance)
Fill a builder with attribute values from the providedCachePolicyinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
statsEnabled
@CanIgnoreReturnValue public final CachePolicyBuilder statsEnabled(boolean statsEnabled)
Initializes the value for thestatsEnabledattribute.If not set, this attribute will have a default value as returned by the initializer of
statsEnabled.- Parameters:
statsEnabled- The value for statsEnabled- Returns:
thisbuilder for use in a chained invocation
-
maxEntries
@CanIgnoreReturnValue public final CachePolicyBuilder maxEntries(long maxEntries)
Initializes the value for themaxEntriesattribute.If not set, this attribute will have a default value as returned by the initializer of
maxEntries.- Parameters:
maxEntries- The value for maxEntries- Returns:
thisbuilder for use in a chained invocation
-
build
public CachePolicy build()
Builds a newCachePolicy.- Returns:
- An immutable instance of CachePolicy
- Throws:
IllegalStateException- if any required attributes are missing
-
-