in core/optaplanner-core-impl/src/main/java/org/optaplanner/core/impl/heuristic/selector/entity/EntitySelectorFactory.java [240:294]
protected void validateSorting(SelectionOrder resolvedSelectionOrder) {
if ((config.getSorterManner() != null || config.getSorterComparatorClass() != null
|| config.getSorterWeightFactoryClass() != null
|| config.getSorterOrder() != null || config.getSorterClass() != null)
&& resolvedSelectionOrder != SelectionOrder.SORTED) {
throw new IllegalArgumentException("The entitySelectorConfig (" + config
+ ") with sorterManner (" + config.getSorterManner()
+ ") and sorterComparatorClass (" + config.getSorterComparatorClass()
+ ") and sorterWeightFactoryClass (" + config.getSorterWeightFactoryClass()
+ ") and sorterOrder (" + config.getSorterOrder()
+ ") and sorterClass (" + config.getSorterClass()
+ ") has a resolvedSelectionOrder (" + resolvedSelectionOrder
+ ") that is not " + SelectionOrder.SORTED + ".");
}
if (config.getSorterManner() != null && config.getSorterComparatorClass() != null) {
throw new IllegalArgumentException("The entitySelectorConfig (" + config
+ ") has both a sorterManner (" + config.getSorterManner()
+ ") and a sorterComparatorClass (" + config.getSorterComparatorClass() + ").");
}
if (config.getSorterManner() != null && config.getSorterWeightFactoryClass() != null) {
throw new IllegalArgumentException("The entitySelectorConfig (" + config
+ ") has both a sorterManner (" + config.getSorterManner()
+ ") and a sorterWeightFactoryClass (" + config.getSorterWeightFactoryClass() + ").");
}
if (config.getSorterManner() != null && config.getSorterClass() != null) {
throw new IllegalArgumentException("The entitySelectorConfig (" + config
+ ") has both a sorterManner (" + config.getSorterManner()
+ ") and a sorterClass (" + config.getSorterClass() + ").");
}
if (config.getSorterManner() != null && config.getSorterOrder() != null) {
throw new IllegalArgumentException("The entitySelectorConfig (" + config
+ ") with sorterManner (" + config.getSorterManner()
+ ") has a non-null sorterOrder (" + config.getSorterOrder() + ").");
}
if (config.getSorterComparatorClass() != null && config.getSorterWeightFactoryClass() != null) {
throw new IllegalArgumentException("The entitySelectorConfig (" + config
+ ") has both a sorterComparatorClass (" + config.getSorterComparatorClass()
+ ") and a sorterWeightFactoryClass (" + config.getSorterWeightFactoryClass() + ").");
}
if (config.getSorterComparatorClass() != null && config.getSorterClass() != null) {
throw new IllegalArgumentException("The entitySelectorConfig (" + config
+ ") has both a sorterComparatorClass (" + config.getSorterComparatorClass()
+ ") and a sorterClass (" + config.getSorterClass() + ").");
}
if (config.getSorterWeightFactoryClass() != null && config.getSorterClass() != null) {
throw new IllegalArgumentException("The entitySelectorConfig (" + config
+ ") has both a sorterWeightFactoryClass (" + config.getSorterWeightFactoryClass()
+ ") and a sorterClass (" + config.getSorterClass() + ").");
}
if (config.getSorterClass() != null && config.getSorterOrder() != null) {
throw new IllegalArgumentException("The entitySelectorConfig (" + config
+ ") with sorterClass (" + config.getSorterClass()
+ ") has a non-null sorterOrder (" + config.getSorterOrder() + ").");
}
}