1 package org.springframework.batch.sample.common;
2
3 /**
4 * Item wrapper useful in "process indicator" usecase, where input is marked as
5 * processed by the processor/writer. This requires passing a technical
6 * identifier of the input data so that it can be modified in later stages.
7 *
8 * @param <T> item type
9 *
10 * @see StagingItemReader
11 * @see StagingItemProcessor
12 *
13 * @author Robert Kasanicky
14 */
15 public class ProcessIndicatorItemWrapper<T> {
16
17 private long id;
18
19 private T item;
20
21 public ProcessIndicatorItemWrapper(long id, T item) {
22 this.id = id;
23 this.item = item;
24 }
25
26 /**
27 * @return id identifying the input data (typically row in database)
28 */
29 public long getId() {
30 return id;
31 }
32
33 /**
34 * @return item (domain object for business processing)
35 */
36 public T getItem() {
37 return item;
38 }
39 }