|
1 | 1 | package ai.timefold.solver.service.definition.internal.descriptor; |
2 | 2 |
|
3 | | -public record ModelBuildInfo(String solverVersion, String version, String buildTime, String branch, |
4 | | - String buildCommit) { |
| 3 | +import io.quarkus.runtime.annotations.RecordableConstructor; |
| 4 | + |
| 5 | +/** |
| 6 | + * Holds build-time metadata about the Timefold Solver model, including version information and source control details |
| 7 | + * captured at build time. |
| 8 | + * |
| 9 | + * @param solverVersion the version of the Timefold Solver used to build the model |
| 10 | + * @param sdkVersion the version of the SDK; deprecated, use {@link #solverVersion()} instead |
| 11 | + * @param version the version of the model |
| 12 | + * @param buildTime the timestamp when the model was built |
| 13 | + * @param branch the source control branch from which the model was built |
| 14 | + * @param buildCommit the source control commit hash from which the model was built |
| 15 | + */ |
| 16 | +public record ModelBuildInfo(String solverVersion, @Deprecated(forRemoval = true) String sdkVersion, String version, |
| 17 | + String buildTime, String branch, String buildCommit) { |
| 18 | + |
| 19 | + private static final ModelBuildInfo EMPTY = new ModelBuildInfo(null, null, null, null, null); |
| 20 | + |
| 21 | + @RecordableConstructor |
| 22 | + public ModelBuildInfo { |
| 23 | + } |
| 24 | + |
| 25 | + public ModelBuildInfo(String solverVersion, String version, String buildTime, String branch, String buildCommit) { |
| 26 | + this(solverVersion, solverVersion, version, buildTime, branch, buildCommit); |
| 27 | + } |
5 | 28 |
|
6 | 29 | public static ModelBuildInfo empty() { |
7 | | - return new ModelBuildInfo(null, null, null, null, null); |
| 30 | + return EMPTY; |
8 | 31 | } |
9 | 32 | } |
0 commit comments