Class CachePolicyBuilder


  • @Generated("org.immutables.processor.ProxyProcessor")
    public final class CachePolicyBuilder
    extends Object
    Builds instances of type CachePolicy. Initialize attributes and then invoke the build() method to create an immutable instance.

    CachePolicyBuilder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

    • Constructor Detail

      • CachePolicyBuilder

        public CachePolicyBuilder()
        Creates a builder for CachePolicy instances.
         new CachePolicyBuilder()
            .statsEnabled(boolean) // optional statsEnabled
            .maxEntries(long) // optional maxEntries
            .build();
         
    • Method Detail

      • from

        @CanIgnoreReturnValue
        public final CachePolicyBuilder from​(CachePolicy instance)
        Fill a builder with attribute values from the provided CachePolicy instance. 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:
        this builder for use in a chained invocation
      • statsEnabled

        @CanIgnoreReturnValue
        public final CachePolicyBuilder statsEnabled​(boolean statsEnabled)
        Initializes the value for the statsEnabled attribute.

        If not set, this attribute will have a default value as returned by the initializer of statsEnabled.

        Parameters:
        statsEnabled - The value for statsEnabled
        Returns:
        this builder for use in a chained invocation
      • maxEntries

        @CanIgnoreReturnValue
        public final CachePolicyBuilder maxEntries​(long maxEntries)
        Initializes the value for the maxEntries attribute.

        If not set, this attribute will have a default value as returned by the initializer of maxEntries.

        Parameters:
        maxEntries - The value for maxEntries
        Returns:
        this builder for use in a chained invocation