Package org.optaplanner.core.config
Class AbstractConfig<Config_ extends AbstractConfig<Config_>>
java.lang.Object
org.optaplanner.core.config.AbstractConfig<Config_>
- Type Parameters:
Config_
- the same class as the implementing subclass
- Direct Known Subclasses:
BenchmarkReportConfig
,ConstructionHeuristicForagerConfig
,EntityPlacerConfig
,LocalSearchAcceptorConfig
,LocalSearchForagerConfig
,MonitoringConfig
,PhaseConfig
,ProblemBenchmarksConfig
,ScoreDirectorFactoryConfig
,SelectorConfig
,SolverBenchmarkConfig
,SolverConfig
,SolverManagerConfig
,TerminationConfig
A config class is a user-friendly, validating configuration class that maps XML input.
It builds the runtime impl classes (which are optimized for scalability and performance instead).
A config class should adhere to "configuration by exception" in its XML/JSON input/output, so all non-static fields should be null by default. Using the config class to build a runtime class, must not alter the config class's XML/JSON output.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract Config_
Typically implemented by constructing a new instance and callinginherit(AbstractConfig)
on it.abstract Config_
Inherits each property of theinheritedConfig
unless that property (or a semantic alternative) is defined by this instance (which overwrites the inherited behaviour).toString()
abstract void
visitReferencedClasses
(Consumer<Class<?>> classVisitor) Call the class visitor on each (possibly null) Class instance provided to this config by the user (including those provided in child configs).
-
Constructor Details
-
AbstractConfig
public AbstractConfig()
-
-
Method Details
-
inherit
Inherits each property of theinheritedConfig
unless that property (or a semantic alternative) is defined by this instance (which overwrites the inherited behaviour).After the inheritance, if a property on this
AbstractConfig
composition is replaced, it should not affect the inherited composition instance.- Parameters:
inheritedConfig
- never null- Returns:
- this
-
copyConfig
Typically implemented by constructing a new instance and callinginherit(AbstractConfig)
on it.- Returns:
- new instance
-
visitReferencedClasses
Call the class visitor on each (possibly null) Class instance provided to this config by the user (including those provided in child configs). Required to create the bean factory in Quarkus.- Parameters:
classVisitor
- The visitor of classes, never null. Can accept null instances of Class.
-
toString
-