@NonNull @CheckResult @SuppressWarnings("unchecked") T load(@Nullable Object model); }
/** * Add bitmap to the cache with the given key. * * @param key The key to retrieve the bitmap. * @param resource The {@link com.bumptech.glide.load.engine.EngineResource} to store. * @return The old value of key (null if key is not in map). */ @Nullable Resource<?> put(@NonNull Key key, @Nullable Resource<?> resource);
@Nullable @Override // It's better to take on the risk that callers may mutate the array when there isn't any reason // for them to do so than it the performance overhead of copying the array with every call. @SuppressWarnings("PMD.MethodReturnsInternalArray") public int[] getPreloadSize(@NonNull T item, int adapterPosition, int itemPosition) { return size; } }
/** * Sets the {@link com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool} implementation to use * to store and retrieve reused {@link android.graphics.Bitmap}s. * * @param bitmapPool The pool to use. * @return This builder. */ @NonNull public GlideBuilder setBitmapPool(@Nullable BitmapPool bitmapPool) { this.bitmapPool = bitmapPool; return this; }