org.springframework.batch.sample.domain.multiline

## 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 by `AggregateItemReader` to identify the start and end of an aggregate record.
  Author:
    Dave Syer
  See Also:
    `AggregateItemReader`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AggregateItem(boolean header, boolean footer)`
    `AggregateItem(T item)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AggregateItem

          public AggregateItem(T item)

      Parameters:
        `item` -

    - #### 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.