Package org.optaplanner.core.impl.score.constraint

## Class DefaultConstraintMatchTotal<Score_ extends Score<Score_>>

- java.lang.Object
- - org.optaplanner.core.impl.score.constraint.DefaultConstraintMatchTotal<Score_>

- All Implemented Interfaces:
    `Comparable<DefaultConstraintMatchTotal<Score_>>`, `ConstraintMatchTotal<Score_>`

      public final class DefaultConstraintMatchTotal<Score_ extends Score<Score_>>
      extends Object
      implements ConstraintMatchTotal<Score_>, Comparable<DefaultConstraintMatchTotal<Score_>>

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DefaultConstraintMatchTotal​(String constraintPackage, String constraintName, Score_ zeroScore)` |
    `DefaultConstraintMatchTotal​(String constraintPackage, String constraintName, Score_ constraintWeight, Score_ zeroScore)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ConstraintMatch<Score_>` | `addConstraintMatch​(List<Object> justificationList, Score_ score)` |
    `int` | `compareTo​(DefaultConstraintMatchTotal<Score_> other)` |
    `boolean` | `equals​(Object o)` |
    `String` | `getConstraintId()` | To create a constraintId, use `ConstraintMatchTotal.composeConstraintId(String, String)`.
    `Set<ConstraintMatch<Score_>>` | `getConstraintMatchSet()` |
    `String` | `getConstraintName()` |
    `String` | `getConstraintPackage()` |
    `Score_` | `getConstraintWeight()` | The value of the `ConstraintWeight` annotated member of the `ConstraintConfiguration`.
    `Score_` | `getScore()` | Sum of the `ConstraintMatchTotal.getConstraintMatchSet()`'s `ConstraintMatch.getScore()`.
    `int` | `hashCode()` |
    `void` | `removeConstraintMatch​(ConstraintMatch<Score_> constraintMatch)` |
    `String` | `toString()` |

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

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

    - ### Methods inherited from interface org.optaplanner.core.api.score.constraint.ConstraintMatchTotal

      `getConstraintMatchCount`

- - ### Constructor Detail

    - #### DefaultConstraintMatchTotal

          public DefaultConstraintMatchTotal​(String constraintPackage,
                                             String constraintName,
                                             Score_ zeroScore)

    - #### DefaultConstraintMatchTotal

          public DefaultConstraintMatchTotal​(String constraintPackage,
                                             String constraintName,
                                             Score_ constraintWeight,
                                             Score_ zeroScore)

  - ### Method Detail

    - #### getConstraintPackage

          public String getConstraintPackage()

      Specified by:
        `getConstraintPackage` in interface `ConstraintMatchTotal<Score_ extends Score<Score_>>`
      Returns:
        never null

    - #### getConstraintName

          public String getConstraintName()

      Specified by:
        `getConstraintName` in interface `ConstraintMatchTotal<Score_ extends Score<Score_>>`
      Returns:
        never null

    - #### getConstraintWeight

          public Score_ getConstraintWeight()

      Description copied from interface: `ConstraintMatchTotal`
      The value of the `ConstraintWeight` annotated member of the `ConstraintConfiguration`. It's independent to the state of the `planning variables`. Do not confuse with `ConstraintMatchTotal.getScore()`.
      Specified by:
        `getConstraintWeight` in interface `ConstraintMatchTotal<Score_ extends Score<Score_>>`
      Returns:
        null if `ConstraintWeight` isn't used for this constraint

    - #### getConstraintMatchSet

          public Set<ConstraintMatch<Score_>> getConstraintMatchSet()

      Specified by:
        `getConstraintMatchSet` in interface `ConstraintMatchTotal<Score_ extends Score<Score_>>`
      Returns:
        never null

    - #### getScore

          public Score_ getScore()

      Description copied from interface: `ConstraintMatchTotal`
      Sum of the `ConstraintMatchTotal.getConstraintMatchSet()`'s `ConstraintMatch.getScore()`.
      Specified by:
        `getScore` in interface `ConstraintMatchTotal<Score_ extends Score<Score_>>`
      Returns:
        never null

    - #### addConstraintMatch

          public ConstraintMatch<Score_> addConstraintMatch​(List<Object> justificationList,
                                                            Score_ score)

    - #### removeConstraintMatch

          public void removeConstraintMatch​(ConstraintMatch<Score_> constraintMatch)

    - #### getConstraintId

          public String getConstraintId()

      Description copied from interface: `ConstraintMatchTotal`
      To create a constraintId, use `ConstraintMatchTotal.composeConstraintId(String, String)`.
      Specified by:
        `getConstraintId` in interface `ConstraintMatchTotal<Score_ extends Score<Score_>>`
      Returns:
        never null

    - #### compareTo

          public int compareTo​(DefaultConstraintMatchTotal<Score_> other)

      Specified by:
        `compareTo` in interface `Comparable<Score_ extends Score<Score_>>`

    - #### 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`