public Typed<T> loader(Loader<T> loader) { if (cache != null) { throw new IllegalStateException("shared cache is already set"); } return new Typed<T>(any, cache, loader, typedCacheBuilder); }
/** * Use a shared cache. */ public Typed<T> cache(Cache<T> cache) { if (cache == null) { throw new IllegalArgumentException("'cache' must not be null"); } return new Typed<T>(any, cache, loader, typedCacheBuilder); }
public <T> Typed<T> cache(Cache<T> cache) { return new Typed<T>(this, null, null, null).cache(cache); }
private Typed<T> typedCacheBuilder(TypedCacheBuilder<T> typedCacheBuilder) { return new Typed<T>(any, cache, loader, typedCacheBuilder); }
public <T> Typed<T> loader(Loader<T> loader) { return new Typed<T>(this, null, null, null).loader(loader); }
public <T> Typed<T> cache(ConcurrentMap<T, MetricId> cache, Loader<T> loader) { return new Typed<T>(this, null, null, null).cache(cache, loader); }
public <T> Typed<T> unbounded(Loader<T> loader) { return new Typed<T>(this, null, null, null).unbounded(loader); }
private Typed<T> any(Any any) { return new Typed<>(any, cache, loader, typedCacheBuilder); } }