Class CacheManager.Configuration

  • Enclosing class:
    CacheManager

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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.time.Duration getDuration()
      The duration of entries after they are written to the cache
      java.lang.Integer getMaximumSize()
      The maximum size of the cache before entries are evicted
      int hashCode()  
      static CacheManager.Configuration of​(int maximumSize)
      A factory method for creating the configuration of a cache with a time-based eviction policy
      static CacheManager.Configuration of​(int maximumSize, java.time.Duration duration)
      A factory method for creating the configuration of a cache with both size and time-based eviction policies
      static CacheManager.Configuration of​(java.time.Duration duration)
      A factory method for creating the configuration of a cache with a time-based eviction policy
      • Methods inherited from class java.lang.Object

        clone, getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getMaximumSize

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

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.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,
                                                    java.time.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​(java.time.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