Record Class Configuration<ModelConfigurationOverrides_>
java.lang.Object
java.lang.Record
ai.timefold.solver.service.definition.api.domain.Configuration<ModelConfigurationOverrides_>
public record Configuration<ModelConfigurationOverrides_>(RunConfiguration run, ModelConfig<ModelConfigurationOverrides_> model, ResourcesConfiguration resourcesConfiguration, MapsConfiguration mapsConfiguration)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionConfiguration(RunConfiguration run, ModelConfig<ModelConfigurationOverrides_> model, ResourcesConfiguration resourcesConfiguration, MapsConfiguration mapsConfiguration) Creates an instance of aConfigurationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <ModelConfigurationOverrides_ extends ModelConfigOverrides>
Configuration<ModelConfigurationOverrides_> empty()Returns a new emptyConfigurationinstance.final booleanIndicates whether some other object is "equal to" this one.static <ModelConfigurationOverrides_ extends ModelConfigOverrides>
ModelConfig<ModelConfigurationOverrides_> getSafeModelConfig(Configuration<ModelConfigurationOverrides_> configuration) Returns theModelConfigfrom the givenConfiguration, or anModelConfig.empty()if the configuration or its underlying model configuration is null.final inthashCode()Returns a hash code value for this object.Returns the value of themapsConfigurationrecord component.model()Returns the value of themodelrecord component.Returns the value of theresourcesConfigurationrecord component.run()Returns the value of therunrecord component.final StringtoString()Returns a string representation of this record class.withRun(RunConfiguration run) Returns a copy of this instance with given run configuration.
-
Constructor Details
-
Configuration
-
Configuration
public Configuration(RunConfiguration run, ModelConfig<ModelConfigurationOverrides_> model, ResourcesConfiguration resourcesConfiguration, MapsConfiguration mapsConfiguration) Creates an instance of aConfigurationrecord class.- Parameters:
run- the value for therunrecord componentmodel- the value for themodelrecord componentresourcesConfiguration- the value for theresourcesConfigurationrecord componentmapsConfiguration- the value for themapsConfigurationrecord component
-
-
Method Details
-
withRun
Returns a copy of this instance with given run configuration.- Parameters:
run- the run configuration to set in the created copy- Returns:
- a copy of this instance with given run configuration, never null
-
empty
public static <ModelConfigurationOverrides_ extends ModelConfigOverrides> Configuration<ModelConfigurationOverrides_> empty()Returns a new emptyConfigurationinstance.- Type Parameters:
ModelConfigurationOverrides_- the specific type ofModelConfigOverridesused in the request- Returns:
- the empty configuration (with both run and model configuration empty)
-
getSafeModelConfig
public static <ModelConfigurationOverrides_ extends ModelConfigOverrides> ModelConfig<ModelConfigurationOverrides_> getSafeModelConfig(Configuration<ModelConfigurationOverrides_> configuration) Returns theModelConfigfrom the givenConfiguration, or anModelConfig.empty()if the configuration or its underlying model configuration is null.- Parameters:
configuration- the configuration to extract the model configuration from- Returns:
- the model configuration, never null
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
run
Returns the value of therunrecord component.- Returns:
- the value of the
runrecord component
-
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
resourcesConfiguration
Returns the value of theresourcesConfigurationrecord component.- Returns:
- the value of the
resourcesConfigurationrecord component
-
mapsConfiguration
Returns the value of themapsConfigurationrecord component.- Returns:
- the value of the
mapsConfigurationrecord component
-