Package org.optaplanner.core.impl.domain.variable.listener

## Interface StatefulVariableListener<Entity_>

- All Superinterfaces:
    `AutoCloseable`, `Closeable`, `Supply`, `VariableListener<Entity_>`, `VariableListener<Entity_>`
  All Known Subinterfaces:
    `SourcedVariableListener<Entity_>`
  All Known Implementing Classes:
    `ExternalizedAnchorVariableSupply`, `ExternalizedCollectionInverseVariableSupply`, `ExternalizedSingletonInverseVariableSupply`

      @Deprecated
      public interface StatefulVariableListener<Entity_>
      extends VariableListener<Entity_>

  Deprecated.
  `VariableListener` can now be stateful too.
  A stateful `VariableListener`, often used to externalize data for a `Supply` from the domain model itself.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `default void` | `clearWorkingSolution​(ScoreDirector scoreDirector)` | Deprecated. Implement `VariableListener.close()` instead.
    `VariableDescriptor` | `getSourceVariableDescriptor()` | Deprecated.
    `void` | `resetWorkingSolution​(ScoreDirector scoreDirector)` | Deprecated. Overrides `VariableListener.resetWorkingSolution(ScoreDirector)`.

    - ### Methods inherited from interface org.optaplanner.core.api.domain.variable.VariableListener

      `close`

    - ### Methods inherited from interface org.optaplanner.core.impl.domain.variable.listener.VariableListener

      `afterEntityAdded, afterEntityRemoved, afterVariableChanged, beforeEntityAdded, beforeEntityRemoved, beforeVariableChanged, requiresUniqueEntityEvents`

- - ### Method Detail

    - #### getSourceVariableDescriptor

          VariableDescriptor getSourceVariableDescriptor()

      Deprecated.

    - #### resetWorkingSolution

          @Deprecated
          void resetWorkingSolution​(ScoreDirector scoreDirector)

      Deprecated.
      Overrides `VariableListener.resetWorkingSolution(ScoreDirector)`.
      Description copied from interface: `VariableListener`
      Called when the entire working solution changes. In this event, the other before..()/after...() methods will not be called. At this point, implementations should clear state, if any.
      Specified by:
        `resetWorkingSolution` in interface `VariableListener<Entity_>`
      Parameters:
        `scoreDirector` -

    - #### clearWorkingSolution

          @Deprecated
          default void clearWorkingSolution​(ScoreDirector scoreDirector)

      Deprecated.
      Implement `VariableListener.close()` instead.
      Parameters:
        `scoreDirector` -