Class AggregateItem<T>


  • public class AggregateItem<T>
    extends java.lang.Object
    A wrapper type for an item that is used by AggregateItemReader to identify the start and end of an aggregate record.
    Author:
    Dave Syer
    See Also:
    AggregateItemReader
    • 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 either isHeader() or isFooter() 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.