/** * Sets the ExpiringEntryLoader to use when loading entries and configures {@link #variableExpiration() variable * expiration}. Either an EntryLoader or ExpiringEntryLoader may be set, not both. * * @param loader to set * @throws NullPointerException if {@code loader} is null * @throws IllegalStateException if an {@link #entryLoader(EntryLoader) EntryLoader} is set */ @SuppressWarnings("unchecked") public <K1 extends K, V1 extends V> Builder<K1, V1> expiringEntryLoader( ExpiringEntryLoader<? super K1, ? super V1> loader) { assertNoLoaderSet(); expiringEntryLoader = (ExpiringEntryLoader<K, V>) Assert.notNull(loader, "loader"); variableExpiration(); return (Builder<K1, V1>) this; }
/** * Sets the ExpiringEntryLoader to use when loading entries and configures {@link #variableExpiration() variable * expiration}. Either an EntryLoader or ExpiringEntryLoader may be set, not both. * * @param loader to set * @throws NullPointerException if {@code loader} is null * @throws IllegalStateException if an {@link #entryLoader(EntryLoader) EntryLoader} is set */ @SuppressWarnings("unchecked") public <K1 extends K, V1 extends V> Builder<K1, V1> expiringEntryLoader( ExpiringEntryLoader<? super K1, ? super V1> loader) { assertNoLoaderSet(); expiringEntryLoader = (ExpiringEntryLoader<K, V>) Assert.notNull(loader, "loader"); variableExpiration(); return (Builder<K1, V1>) this; }
/** * Sets the EntryLoader to use when loading entries. Either an EntryLoader or ExpiringEntryLoader may be set, not * both. * * @param loader to set * @throws NullPointerException if {@code loader} is null * @throws IllegalStateException if an {@link #expiringEntryLoader(ExpiringEntryLoader) ExpiringEntryLoader} is set */ @SuppressWarnings("unchecked") public <K1 extends K, V1 extends V> Builder<K1, V1> entryLoader(EntryLoader<? super K1, ? super V1> loader) { assertNoLoaderSet(); entryLoader = (EntryLoader<K, V>) Assert.notNull(loader, "loader"); return (Builder<K1, V1>) this; }
/** * Sets the ExpiringEntryLoader to use when loading entries and configures {@link #variableExpiration() variable * expiration}. Either an EntryLoader or ExpiringEntryLoader may be set, not both. * * @param loader to set * @throws NullPointerException if {@code loader} is null * @throws IllegalStateException if an {@link #entryLoader(EntryLoader) EntryLoader} is set */ @SuppressWarnings("unchecked") public <K1 extends K, V1 extends V> Builder<K1, V1> expiringEntryLoader( ExpiringEntryLoader<? super K1, ? super V1> loader) { assertNoLoaderSet(); expiringEntryLoader = (ExpiringEntryLoader<K, V>) Assert.notNull(loader, "loader"); variableExpiration(); return (Builder<K1, V1>) this; }
/** * Sets the EntryLoader to use when loading entries. Either an EntryLoader or ExpiringEntryLoader may be set, not * both. * * @param loader to set * @throws NullPointerException if {@code loader} is null * @throws IllegalStateException if an {@link #expiringEntryLoader(ExpiringEntryLoader) ExpiringEntryLoader} is set */ @SuppressWarnings("unchecked") public <K1 extends K, V1 extends V> Builder<K1, V1> entryLoader(EntryLoader<? super K1, ? super V1> loader) { assertNoLoaderSet(); entryLoader = (EntryLoader<K, V>) Assert.notNull(loader, "loader"); return (Builder<K1, V1>) this; }
/** * Sets the EntryLoader to use when loading entries. Either an EntryLoader or ExpiringEntryLoader may be set, not * both. * * @param loader to set * @throws NullPointerException if {@code loader} is null * @throws IllegalStateException if an {@link #expiringEntryLoader(ExpiringEntryLoader) ExpiringEntryLoader} is set */ @SuppressWarnings("unchecked") public <K1 extends K, V1 extends V> Builder<K1, V1> entryLoader(EntryLoader<? super K1, ? super V1> loader) { assertNoLoaderSet(); entryLoader = (EntryLoader<K, V>) Assert.notNull(loader, "loader"); return (Builder<K1, V1>) this; }