org.optaplanner.core.api.score.stream

## Interface Constraint

- All Known Implementing Classes:
    BavetConstraint, DroolsConstraint

      public interface Constraint

  This represents a single constraint in the `ConstraintStream` API that impacts the `Score`. It is defined in `ConstraintProvider.defineConstraints(ConstraintFactory)` by calling `ConstraintFactory.from(Class)`.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `ConstraintFactory` | `getConstraintFactory()` The `ConstraintFactory` that build this.
    `default String` | `getConstraintId()` The constraint id is `the constraint package` concatenated with "/" and `the constraint name`.
    `String` | `getConstraintName()` The constraint name.
    `String` | `getConstraintPackage()` The constraint package is the namespace of the constraint.

- - ### Method Detail

    - #### getConstraintFactory

          ConstraintFactory getConstraintFactory()

      The `ConstraintFactory` that build this.
      Returns:
        never null

    - #### getConstraintPackage

          String getConstraintPackage()

      The constraint package is the namespace of the constraint.

      When using a `ConstraintConfiguration`, it is equal to the `ConstraintWeight.constraintPackage()`.

      Returns:
        never null

    - #### getConstraintName

          String getConstraintName()

      The constraint name. It might not be unique, but `getConstraintId()` is unique.

      When using a `ConstraintConfiguration`, it is equal to the `ConstraintWeight.value()`.

      Returns:
        never null

    - #### getConstraintId

          default String getConstraintId()

      The constraint id is `the constraint package` concatenated with "/" and `the constraint name`. It is unique.
      Returns:
        never null

Copyright © 2006–2019 JBoss by Red Hat. All rights reserved.