Skip to content

Commit 404455f

Browse files
authored
docs: Better explain the requirements for @PlanningId properties (#1529)
The current text states that an `@PlanningId` property must implement `Object#equals()` and `Object#hashCode()`. If they are instantiable types, they automatically implement those methods, although not in accordance with the respective contracts.
1 parent 90236a3 commit 404455f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/src/modules/ROOT/pages/using-timefold-solver/modeling-planning-problems.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ A `@PlanningId` property must be:
196196
* Unique for that specific class
197197
** It does not need to be unique across different problem fact classes
198198
(unless in that rare case that those classes are mixed in the same value range or planning entity collection).
199-
* An instance of a type that implements `Object.hashCode()` and `Object.equals()`.
199+
* An instance of a type that implements `Object.hashCode()` and `Object.equals()`. See the Javadoc on the https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html[`java.lang.Object` class] for details.
200200
** It's recommended to use the type `Integer`, `int`, `Long`, `long`, `String` or `UUID`.
201201
* Never `null` by the time `Solver.solve()` is called.
202202
@@ -3076,4 +3076,4 @@ public interface TestdataBaseEntity {
30763076
...
30773077
}
30783078
----
3079-
====
3079+
====

0 commit comments

Comments
 (0)