Class CaffeineParser


  • public final class CaffeineParser
    extends Object
    A configuration parser for the Caffeine builder.

    • initial-capacity=[integer]: sets Caffeine.initialCapacity.
    • maximum-size=[long]: sets Caffeine.maximumSize.
    • weak-keys=[condition]: sets Caffeine.weakKeys().
    • weak-values=[condition]: sets Caffeine.weakValues().
    • soft-values=[condition]: sets Caffeine.softValues().
    • record-stats=[condition]: sets Caffeine.recordStats().
    • executor=[string]: sets Caffeine.executor.
    It is illegal to use the following configurations together:
    • maximumSize and maximumWeight
    • weakValues and softValues set to true

    CaffeineParser does not support configuring Caffeine methods with non-value parameters. These must be configured in code.

    • Method Detail

      • from

        public static com.github.benmanes.caffeine.cache.Caffeine<Object,​Object> from​(com.typesafe.config.Config config,
                                                                                            ActorSystem actorSystem)
        Returns a configured Caffeine cache builder.