Class CacheManager.Configuration

  • Enclosing class:
    CacheManager

    public static class CacheManager.Configuration
    extends Object
    A configuration class used by the cache manager to create managed cache instances with size and/or time-based eviction policies
    • Method Detail

      • getMaximumSize

        public Integer getMaximumSize()
        The maximum size of the cache before entries are evicted
        Returns:
        the maximum size or null
      • getDuration

        public Duration getDuration()
        The duration of entries after they are written to the cache
        Returns:
        the duration or null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • of

        public static CacheManager.Configuration of​(int maximumSize)
        A factory method for creating the configuration of a cache with a time-based eviction policy
        Parameters:
        maximumSize - the maximum size
        Returns:
        a configuration instance
      • of

        public static CacheManager.Configuration of​(int maximumSize,
                                                    Duration duration)
        A factory method for creating the configuration of a cache with both size and time-based eviction policies
        Parameters:
        maximumSize - the maximum size
        duration - the duration
        Returns:
        a configuration instance
      • of

        public static CacheManager.Configuration of​(Duration duration)
        A factory method for creating the configuration of a cache with a time-based eviction policy
        Parameters:
        duration - the duration
        Returns:
        a configuration instance