Package org.springframework.batch.core.step.tasklet

# Class ConfigurableSystemProcessExitCodeMapper

java.lang.Object
org.springframework.batch.core.step.tasklet.ConfigurableSystemProcessExitCodeMapper

All Implemented Interfaces:
  `SystemProcessExitCodeMapper`

public class ConfigurableSystemProcessExitCodeMapper extends Object implements SystemProcessExitCodeMapper
Maps exit codes to `ExitStatus` according to injected map. The injected map is required to contain a value for 'else' key, this value will be returned if the injected map does not contain value for the exit code returned by the system process.

Author:
  Robert Kasanicky

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ELSE_KEY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConfigurableSystemProcessExitCodeMapper()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ExitStatus`
  `getExitStatus(int exitCode)`
  `void`
  `setMappings(Map<Object,ExitStatus> mappings)`

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

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

- ## Field Details

  - ### ELSE_KEY

    public static final String ELSE_KEY
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ConfigurableSystemProcessExitCodeMapper

    public ConfigurableSystemProcessExitCodeMapper()

- ## Method Details

  - ### getExitStatus

    public ExitStatus getExitStatus(int exitCode)
    Specified by:
      `getExitStatus` in interface `SystemProcessExitCodeMapper`
    Parameters:
      `exitCode` - exit code returned by the system process
    Returns:
      ExitStatus appropriate for the `systemExitCode` parameter value

  - ### setMappings

    public void setMappings(Map<Object,ExitStatus> mappings)
    Parameters:
      `mappings` - `Integer` exit code keys to `ExitStatus` values.