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 Details

  • 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 empty Configuration instance.
      Type Parameters:
      ModelConfigurationOverrides_ - the specific type of ModelConfigOverrides used 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 the ModelConfig from the given Configuration, or an ModelConfig.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

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • run

      public RunConfiguration run()
      Returns the value of the run record component.
      Returns:
      the value of the run record component
    • model

      Returns the value of the model record component.
      Returns:
      the value of the model record component
    • resourcesConfiguration

      public ResourcesConfiguration resourcesConfiguration()
      Returns the value of the resourcesConfiguration record component.
      Returns:
      the value of the resourcesConfiguration record component
    • mapsConfiguration

      public MapsConfiguration mapsConfiguration()
      Returns the value of the mapsConfiguration record component.
      Returns:
      the value of the mapsConfiguration record component