@Test public void testReadingOfMemoryPolicies() { MemoryPolicy expireAfterWritePolicy = MemoryPolicy.builder() .setExpireAfterWrite(1) .setExpireAfterTimeUnit(TimeUnit.HOURS) .build(); NoopPersister.create(expireAfterWritePolicy); MemoryPolicy expireAfterAccessPolicy = MemoryPolicy.builder() .setExpireAfterAccess(1) .setExpireAfterTimeUnit(TimeUnit.HOURS) .build(); NoopPersister.create(expireAfterAccessPolicy); exception.expect(IllegalArgumentException.class); exception.expectMessage("No expiry policy set"); MemoryPolicy incompletePolicy = MemoryPolicy.builder() .setExpireAfterTimeUnit(TimeUnit.HOURS) .build(); NoopPersister.create(incompletePolicy); }
public static <Raw, Key> NoopPersister<Raw, Key> create() { return NoopPersister.create(null); }
NoopPersister implements Persister<Raw, Key>, Clearable<Key> { public static <Raw, Key> NoopPersister<Raw, Key> create() { return NoopPersister.create(null); } }
NoopPersister implements Persister<Raw, Key>, Clearable<Key> { public static <Raw, Key> NoopPersister<Raw, Key> create() { return NoopPersister.create(null); } NoopPersister(MemoryPolicy memoryPolicy); }
NoopPersister implements Persister<Raw, Key>, Clearable<Key> { public static <Raw, Key> NoopPersister<Raw, Key> create() { return NoopPersister.create(null); } NoopPersister(MemoryPolicy memoryPolicy); static NoopPersister<Raw, Key> create(); static NoopPersister<Raw, Key> create(MemoryPolicy memoryPolicy); @Nonnull @Override Maybe<Raw> read(@Nonnull Key key); @Nonnull @Override Single<Boolean> write(@Nonnull Key key, @Nonnull Raw raw); @Override void clear(@Nonnull Key key); }
NoopPersister implements Persister<Raw, Key>, Clearable<Key> { public static <Raw, Key> NoopPersister<Raw, Key> create() { return NoopPersister.create(null); } NoopPersister(MemoryPolicy memoryPolicy); static NoopPersister<Raw, Key> create(); static NoopPersister<Raw, Key> create(MemoryPolicy memoryPolicy); @Nonnull @Override Maybe<Raw> read(@Nonnull Key key); @Nonnull @Override Single<Boolean> write(@Nonnull Key key, @Nonnull Raw raw); @Override void clear(@Nonnull Key key);  }