Class CacheOptions

java.lang.Object
io.github.emcw.caching.CacheOptions

public class CacheOptions extends Object
  • Constructor Details

    • CacheOptions

      public CacheOptions(CacheStrategy strategy, long duration, @NotNull @NotNull TimeUnit unit)
      Creates a new options instance that will be passed when building a cache.

      If strategy is CacheStrategy.TIME_BASED, the cache will automatically update after the duration, otherwise it must be CacheStrategy.LAZY and will be emptied until
      Parameters:
      strategy - The strategy for the cache to use when updating.
      duration - Amount of time until strategy-dependenant logic happens.
      unit - Time unit to base duration on. Min, sec, ms etc.