コード例 #1
0
 /**
  * This ctor allows to preset the value. This can be used if the value is available when
  * initialized but may be reclaimed during processing.
  *
  * @param elementSize The size of the value in the cache in bytes.
  * @param supplier
  */
 public CachedLazyInit(T value, int elementSize, Supplier<T> supplier) {
   super(supplier);
   cache.putIfAbsent(cacheKey, value, elementSize);
   this.elementSize = elementSize;
 }