Class SingleItemPeekableItemReader<T>

All Implemented Interfaces:
ItemReader<T>, ItemStream, ItemStreamReader<T>, PeekableItemReader<T>

public class SingleItemPeekableItemReader<T> extends Object implements ItemStreamReader<T>, PeekableItemReader<T>

A PeekableItemReader that allows the user to peek one item ahead. Repeated calls to peek() will return the same item, and this will be the next item returned from read().

Intentionally not thread-safe: it wouldn't be possible to honour the peek in multiple threads because only one of the threads that peeked would get that item in the next call to read.

Dave Syer, Mahmoud Ben Hassine