Package: groovy.console.ui

## [Groovy] Class HistoryRecord

- groovy.console.ui.HistoryRecord

-     @CompileStatic
      class HistoryRecord
      extends Object

  Captures the editor state and execution outcome for a console history entry.

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `String` | `allText` Full editor contents captured for this history entry.
    `Throwable` | `exception` Execution failure, when evaluation did not complete successfully.
    `Object` | `result` Execution result, when evaluation completed successfully.
    `String` | `scriptName` Generated script name used during execution.
    `int` | `selectionEnd` End offset of the selected text.
    `int` | `selectionStart` Start offset of the selected text.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `HistoryRecord()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `String` | `getTextToRun(boolean useSelection)` Returns the text that should be executed for this history entry.
    `` | `Object` | `getValue()` Returns the execution result or captured exception.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Property Detail

    - #### String allText

      Full editor contents captured for this history entry.

    - #### Throwable exception

      Execution failure, when evaluation did not complete successfully.

    - #### Object result

      Execution result, when evaluation completed successfully.

    - #### String scriptName

      Generated script name used during execution.

    - #### int selectionEnd

      End offset of the selected text.

    - #### int selectionStart

      Start offset of the selected text.

  - ### Constructor Detail

    - #### HistoryRecord()

  - ### Method Detail

    - #### String getTextToRun(boolean useSelection)

      Returns the text that should be executed for this history entry.

      Parameters:
        `useSelection` - whether to execute only the current selection
      Returns:
        the selected text with leading imports, or the full script text

    - #### Object getValue()

      Returns the execution result or captured exception.

      Returns:
        the successful result, or the exception when execution failed