Package org.apache.groovy.contracts.generation

# Class ContractExecutionTracker

java.lang.Object
org.apache.groovy.contracts.generation.ContractExecutionTracker

public class ContractExecutionTracker extends Object
Keeps track of contract executions to avoid cyclic contract checks.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `ContractExecutionTracker.ContractExecution`
  Identifies one contract execution so recursive re-entry can be suppressed.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ContractExecutionTracker()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `clear(String className, String methodIdentifier, String assertionType, boolean isStatic)`
  Removes a previously tracked contract execution from the current thread.
  `static boolean`
  `track(String className, String methodIdentifier, String assertionType, boolean isStatic)`
  Attempts to register a contract execution for the current thread.

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

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

- ## Constructor Details

  - ### ContractExecutionTracker

    public ContractExecutionTracker()

- ## Method Details

  - ### track

    public static boolean track(String className, String methodIdentifier, String assertionType, boolean isStatic)
    Attempts to register a contract execution for the current thread.
    Parameters:
      `className` - the declaring class name
      `methodIdentifier` - the executable identifier
      `assertionType` - the logical contract kind
      `isStatic` - whether the executable is static
    Returns:
      `true` if the execution was newly tracked, `false` if it was already active

  - ### clear

    public static void clear(String className, String methodIdentifier, String assertionType, boolean isStatic)
    Removes a previously tracked contract execution from the current thread.
    Parameters:
      `className` - the declaring class name
      `methodIdentifier` - the executable identifier
      `assertionType` - the logical contract kind
      `isStatic` - whether the executable is static