class RedisItemWriterBuilder<K, V> {

	private RedisTemplate<K, V> redisTemplate;

	private Converter<V, K> itemKeyMapper;

	private boolean delete;

	/**
	 * Set the {@link RedisTemplate} to use to write items to Redis.
	 * @param redisTemplate the template to use.
	 * @return The current instance of the builder.
	 * @see RedisItemWriter#setRedisTemplate(RedisTemplate)
	 */
	public RedisItemWriterBuilder<K, V> redisTemplate(RedisTemplate<K, V> redisTemplate) {
		this.redisTemplate = redisTemplate;
		return this;
	}

	/**
	 * Set the {@link Converter} to use to derive the key from the item.
	 * @param itemKeyMapper the Converter to use.
	 * @return The current instance of the builder.
	 * @see RedisItemWriter#setItemKeyMapper(Converter)
	 */
	public RedisItemWriterBuilder<K, V> itemKeyMapper(Converter<V, K> itemKeyMapper) {
		this.itemKeyMapper = itemKeyMapper;
		return this;
	}

	/**
	 * Indicate if the items being passed to the writer should be deleted.
	 * @param delete removal indicator.
	 * @return The current instance of the builder.
	 * @see RedisItemWriter#setDelete(boolean)
	 */
	public RedisItemWriterBuilder<K, V> delete(boolean delete) {
		this.delete = delete;
		return this;
	}

	/**
	 * Validates and builds a {@link RedisItemWriter}.
	 * @return a {@link RedisItemWriter}
	 */
	public RedisItemWriter<K, V> build() {<FILL_FUNCTION_BODY>}

}

		Assert.notNull(this.redisTemplate, "RedisTemplate is required.");
		Assert.notNull(this.itemKeyMapper, "itemKeyMapper is required.");

		RedisItemWriter<K, V> writer = new RedisItemWriter<>();
		writer.setRedisTemplate(this.redisTemplate);
		writer.setItemKeyMapper(this.itemKeyMapper);
		writer.setDelete(this.delete);
		return writer;
	
<no_super_class>