Lines Matching full:delegate
79 public static <T> Supplier<T> memoize(Supplier<T> delegate) {
80 return new MemoizingSupplier<T>(Preconditions.checkNotNull(delegate));
85 final Supplier<T> delegate;
89 MemoizingSupplier(Supplier<T> delegate) {
90 this.delegate = delegate;
95 value = delegate.get();
105 * Returns a supplier that caches the instance supplied by the delegate and
123 Supplier<T> delegate, long duration, TimeUnit unit) {
124 return new ExpiringMemoizingSupplier<T>(delegate, duration, unit);
129 final Supplier<T> delegate;
136 Supplier<T> delegate, long duration, TimeUnit unit) {
137 this.delegate = Preconditions.checkNotNull(delegate);
144 value = delegate.get();
176 * {@code delegate} before calling it, making it thread-safe.
178 public static <T> Supplier<T> synchronizedSupplier(Supplier<T> delegate) {
179 return new ThreadSafeSupplier<T>(Preconditions.checkNotNull(delegate));
184 final Supplier<T> delegate;
186 ThreadSafeSupplier(Supplier<T> delegate) {
187 this.delegate = delegate;
190 synchronized (delegate) {
191 return delegate.get();