Interface Constraint

All Known Implementing Classes:
AbstractConstraint, BavetConstraint

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.forEach(Class).
  • Field Details

  • Method Details

    • getConstraintFactory

      @Deprecated(forRemoval=true) ConstraintFactory getConstraintFactory()
      Deprecated, for removal: This API element is subject to removal in a future version.
      for removal as it is not necessary on the public API.
      The ConstraintFactory that built this.
      Returns:
      never null
    • getConstraintRef

      ConstraintRef getConstraintRef()
    • getDescription

      default @NonNull String getDescription()
      Returns a human-friendly description of the constraint. The format of the description is left unspecified and will not be parsed in any way.
      Returns:
      may be left empty
    • getConstraintGroup

      default @NonNull String getConstraintGroup()
    • getConstraintWeight

      default <Score_ extends Score<Score_>> @Nullable Score_ getConstraintWeight()
      Returns the weight of the constraint as defined in the ConstraintProvider, without any overrides.
      Returns:
      null if the constraint does not have a weight defined
    • getConstraintPackage

      @Deprecated(forRemoval=true, since="1.4.0") default String getConstraintPackage()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      never null
    • getConstraintName

      @Deprecated(forRemoval=true, since="1.4.0") default String getConstraintName()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      never null
    • getConstraintId

      @Deprecated(forRemoval=true, since="1.4.0") default String getConstraintId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      never null