org.springframework.batch.sample.domain.trade.internal

## Class TradeProcessor

- java.lang.Object
- - org.springframework.batch.sample.domain.trade.internal.TradeProcessor

- All Implemented Interfaces:
    ItemProcessor<Trade,Trade>

      public class TradeProcessor
      extends java.lang.Object
      implements ItemProcessor<Trade,Trade>

  Processes the Trade - throwing validation errors if necessary.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TradeProcessor()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Trade` | `process(Trade item)` Process the provided item, returning a potentially modified or new item for continued processing.
    `void` | `setValidationFailure(int failure)` Public setter for the the index on which failure should occur.

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

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

- - ### Constructor Detail

    - #### TradeProcessor

          public TradeProcessor()

  - ### Method Detail

    - #### setValidationFailure

          public void setValidationFailure(int failure)

      Public setter for the the index on which failure should occur.
      Parameters:
        `failure` - the failure to set

    - #### process

          public Trade process(Trade item)
                        throws java.lang.Exception

      Description copied from interface: `ItemProcessor`
      Process the provided item, returning a potentially modified or new item for continued processing. If the returned result is null, it is assumed that processing of the item should not continue.
      Specified by:
        `process` in interface `ItemProcessor<Trade,Trade>`
      Parameters:
        `item` - to be processed
      Returns:
        potentially modified or new item for continued processing, null if processing of the provided item should not continue.
      Throws:
        `java.lang.Exception`