class RedisItemReader<K, V> implements ItemStreamReader<V> {

	private final RedisTemplate<K, V> redisTemplate;

	private final ScanOptions scanOptions;

	private Cursor<K> cursor;

	public RedisItemReader(RedisTemplate<K, V> redisTemplate, ScanOptions scanOptions) {
		Assert.notNull(redisTemplate, "redisTemplate must not be null");
		Assert.notNull(scanOptions, "scanOptions must no be null");
		this.redisTemplate = redisTemplate;
		this.scanOptions = scanOptions;
	}

	@Override
	public void open(ExecutionContext executionContext) throws ItemStreamException {
		this.cursor = this.redisTemplate.scan(this.scanOptions);
	}

	@Override
	public V read() throws Exception {<FILL_FUNCTION_BODY>}

	@Override
	public void close() throws ItemStreamException {
		this.cursor.close();
	}

}

		if (this.cursor.hasNext()) {
			K nextKey = this.cursor.next();
			return this.redisTemplate.opsForValue().get(nextKey);
		}
		else {
			return null;
		}
	
<no_super_class>