com.microfocus.awm.control.toolexecution

## Class ToolResultSeverity

- java.lang.Object
- - com.microfocus.awm.control.toolexecution.ToolResultSeverity

- All Implemented Interfaces:
    IToolResultSeverity

      public class ToolResultSeverity
      extends java.lang.Object
      implements IToolResultSeverity

  Standard implementation of `IToolResultSeverity`. Allows defining a tool result severity based on `EToolResultSeverity`.
  Author:
    Micro Focus
  See Also:
    `ToolResultSeverity(ToolDescriptor, EToolResultSeverity)`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static IToolResultSeverity` | `OK` OK severity with return code `0`.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ToolResultSeverity(int pReturnCode)` Creates a tool result severity from a return code.
    `ToolResultSeverity(ToolDescriptor pTool, EToolResultSeverity pSeverity)` Creates a tool result severity from an `EToolResultSeverity` enum value.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getReturnCode()` Gets the return code, which reflects the severity in combination with the maximum return code of the AWM application's `ApplicationOptions`.

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

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

- - ### Field Detail

    - #### OK

          public static final IToolResultSeverity OK

      OK severity with return code `0`.

  - ### Constructor Detail

    - #### ToolResultSeverity

          public ToolResultSeverity(int pReturnCode)

      Creates a tool result severity from a return code.
      Parameters:
        `pReturnCode` - the return code

    - #### ToolResultSeverity

          public ToolResultSeverity(ToolDescriptor pTool,
                                    EToolResultSeverity pSeverity)

      Creates a tool result severity from an `EToolResultSeverity` enum value. Automatically sets a return code based on the current model
      Parameters:
        `pTool` - the executed tool
        `pSeverity` - the severity

  - ### Method Detail

    - #### getReturnCode

          public int getReturnCode()

      Description copied from interface: `IToolResultSeverity`
      Gets the return code, which reflects the severity in combination with the maximum return code of the AWM application's `ApplicationOptions`.

      Only tools which utilize return codes in a flexible way (e.g. command based tools) should return custom return codes. All other tools should consider using `ToolResultSeverity(com.microfocus.awm.meta.interfaces.ToolDescriptor, com.microfocus.awm.model.EToolResultSeverity)` to return status based return codes.

      Specified by:
        `getReturnCode` in interface `IToolResultSeverity`
      Returns:
        the return code
      See Also:
        `ApplicationOptions.getMaxRC()`, `ToolResultSeverity`

Copyright © 2015 Micro Focus GmbH. All rights reserved.