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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.for removal as it is not necessary on the public API.default @NonNull Stringdefault StringDeprecated, for removal: This API element is subject to removal in a future version.PrefergetConstraintRef().default StringDeprecated, for removal: This API element is subject to removal in a future version.PrefergetConstraintRef().default StringDeprecated, for removal: This API element is subject to removal in a future version.PrefergetConstraintRef().default <Score_ extends Score<Score_>>
@Nullable Score_Returns the weight of the constraint as defined in theConstraintProvider, without any overrides.default @NonNull StringReturns a human-friendly description of the constraint.
-
Field Details
-
DEFAULT_CONSTRAINT_GROUP
- See Also:
-
-
Method Details
-
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.TheConstraintFactorythat built this.- Returns:
- never null
-
getConstraintRef
ConstraintRef getConstraintRef() -
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
-
getConstraintWeight
Returns the weight of the constraint as defined in theConstraintProvider, without any overrides.- Returns:
- null if the constraint does not have a weight defined
-
getConstraintPackage
Deprecated, for removal: This API element is subject to removal in a future version.PrefergetConstraintRef().- Returns:
- never null
-
getConstraintName
Deprecated, for removal: This API element is subject to removal in a future version.PrefergetConstraintRef().- Returns:
- never null
-
getConstraintId
Deprecated, for removal: This API element is subject to removal in a future version.PrefergetConstraintRef().- Returns:
- never null
-