Class AggregateItem<T>
- java.lang.Object
- org.springframework.batch.sample.domain.multiline.AggregateItem<T>
public class AggregateItem<T> extends java.lang.Object
A wrapper type for an item that is used byAggregateItemReader
to identify the start and end of an aggregate record.- Author:
- Dave Syer
- See Also:
AggregateItemReader
Constructor Summary
Constructors Constructor Description AggregateItem(boolean header, boolean footer)
AggregateItem(T item)
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> AggregateItem<T>
getFooter()
static <T> AggregateItem<T>
getHeader()
T
getItem()
Accessor for the wrapped item.boolean
isFooter()
Responds true if this record is a footer in an aggregate.boolean
isHeader()
Responds true if this record is a header in an aggregate.
Constructor Detail
AggregateItem
public AggregateItem(T item)
- Parameters:
item
- the item to wrap
AggregateItem
public AggregateItem(boolean header, boolean footer)
Method Detail
getFooter
public static <T> AggregateItem<T> getFooter()
- Type Parameters:
T
- the type of item nominally wrapped- Returns:
- a static
AggregateItem
that is a footer.
getHeader
public static <T> AggregateItem<T> getHeader()
- Type Parameters:
T
- the type of item nominally wrapped- Returns:
- a static
AggregateItem
that is a header.
getItem
public T getItem()
Accessor for the wrapped item.- Returns:
- the wrapped item
- Throws:
java.lang.IllegalStateException
- if called on a record for which eitherisHeader()
orisFooter()
answers true.
isFooter
public boolean isFooter()
Responds true if this record is a footer in an aggregate.- Returns:
- true if this is the end of an aggregate record.
isHeader
public boolean isHeader()
Responds true if this record is a header in an aggregate.- Returns:
- true if this is the beginning of an aggregate record.