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

## Class CustomShadowVariableDemand<Solution_>

- java.lang.Object
- - org.optaplanner.core.impl.domain.variable.custom.CustomShadowVariableDemand<Solution_>

- All Implemented Interfaces:
    `Demand<Solution_,​SingletonInverseVariableSupply>`

      public class CustomShadowVariableDemand<Solution_>
      extends Object
      implements Demand<Solution_,​SingletonInverseVariableSupply>

  Unlike other `Demand`s, a custom demand isn't equalized based on its sources, but based on its target. Therefore a custom shadow variable cannot be reused by built-in systems.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `CustomShadowVariableDemand​(CustomShadowVariableDescriptor<Solution_> targetShadowVariableDescriptor)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `SingletonInverseVariableSupply` | `createExternalizedSupply​(InnerScoreDirector<Solution_,​?> scoreDirector)` | Only called if the domain model doesn't already support the demand (through a shadow variable usually).
    `boolean` | `equals​(Object o)` |
    `int` | `hashCode()` |
    `String` | `toString()` |

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### CustomShadowVariableDemand

          public CustomShadowVariableDemand​(CustomShadowVariableDescriptor<Solution_> targetShadowVariableDescriptor)

  - ### Method Detail

    - #### createExternalizedSupply

          public SingletonInverseVariableSupply createExternalizedSupply​(InnerScoreDirector<Solution_,​?> scoreDirector)

      Description copied from interface: `Demand`
      Only called if the domain model doesn't already support the demand (through a shadow variable usually). Equal demands share the same `Supply`.
      Specified by:
        `createExternalizedSupply` in interface `Demand<Solution_,​SingletonInverseVariableSupply>`
      Parameters:
        `scoreDirector` - never null
      Returns:
        never null

    - #### equals

          public boolean equals​(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`