Commit ca0eb30
refactor!: Convert Task class to Java record
Refactored the Task class in the spec module from a final class to a
Java record to reduce boilerplate code and leverage modern Java features.
Key changes:
- Converted Task to record with compact canonical constructor
- Preserved validation and defensive copying logic
- Added deprecated getter methods for backward compatibility
- Updated Builder to use record accessor methods
Benefits:
- Automatic equals(), hashCode(), and toString() implementations
- Improved code readability and maintainability
- Zero breaking changes (deprecated getters maintain API compatibility)
Breaking change note: This is marked as breaking because while we
maintain backward compatibility through deprecated methods, the
underlying class structure has changed from a class to a record.
See ADR 0002 (doc/adr/0002-refactor-task-to-java-record.md) for
detailed architectural decision and rationale.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent cb084ec commit ca0eb30
File tree
43 files changed
+970
-874
lines changed- client
- base/src/main/java/io/a2a/client
- transport
- jsonrpc/src/test/java/io/a2a/client/transport/jsonrpc
- sse
- rest/src/test/java/io/a2a/client/transport/rest
- doc/adr
- examples/cloud-deployment/server/src/test/java/io/a2a/examples/cloud
- extras
- push-notification-config-store-database-jpa/src/test/java/io/a2a/extras/pushnotificationconfigstore/database/jpa
- queue-manager-replicated
- core/src/test/java/io/a2a/extras/queuemanager/replicated/core
- tests-multi-instance/tests/src/test/java/io/a2a/extras/queuemanager/replicated/tests/multiinstance
- tests-single-instance/src/test/java/io/a2a/extras/queuemanager/replicated/tests
- task-store-database-jpa/src
- main/java/io/a2a/extras/taskstore/database/jpa
- test/java/io/a2a/extras/taskstore/database/jpa
- reference/jsonrpc/src/test/java/io/a2a/server/apps/quarkus
- server-common/src
- main/java/io/a2a/server
- events
- requesthandlers
- tasks
- test/java/io/a2a/server
- agentexecution
- requesthandlers
- tasks
- spec-grpc/src/test/java/io/a2a/grpc
- mapper
- utils
- spec/src
- main/java/io/a2a
- spec
- util
- test/java/io/a2a/spec
- tck/src/main/java/io/a2a/tck/server
- tests/server-common/src/test/java/io/a2a/server/apps/common
- transport
- grpc/src/test/java/io/a2a/transport/grpc/handler
- jsonrpc/src/test/java/io/a2a/transport/jsonrpc/handler
- rest/src/test/java/io/a2a/transport/rest/handler
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
43 files changed
+970
-874
lines changedLines changed: 14 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
78 | 74 | | |
79 | 75 | | |
80 | | - | |
| 76 | + | |
81 | 77 | | |
82 | 78 | | |
83 | 79 | | |
| |||
95 | 91 | | |
96 | 92 | | |
97 | 93 | | |
98 | | - | |
| 94 | + | |
99 | 95 | | |
100 | 96 | | |
101 | 97 | | |
| |||
114 | 110 | | |
115 | 111 | | |
116 | 112 | | |
117 | | - | |
118 | | - | |
| 113 | + | |
| 114 | + | |
119 | 115 | | |
120 | 116 | | |
121 | 117 | | |
122 | | - | |
123 | | - | |
124 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
125 | 121 | | |
126 | 122 | | |
127 | 123 | | |
| |||
132 | 128 | | |
133 | 129 | | |
134 | 130 | | |
135 | | - | |
136 | | - | |
| 131 | + | |
| 132 | + | |
137 | 133 | | |
138 | 134 | | |
139 | 135 | | |
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
Lines changed: 38 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | | - | |
| 248 | + | |
| 249 | + | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| |||
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
567 | | - | |
568 | | - | |
569 | | - | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
| |||
613 | 613 | | |
614 | 614 | | |
615 | 615 | | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
627 | | - | |
| 627 | + | |
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
| |||
671 | 671 | | |
672 | 672 | | |
673 | 673 | | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
685 | | - | |
| 685 | + | |
686 | 686 | | |
687 | 687 | | |
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
Lines changed: 29 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | | - | |
| 215 | + | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
| |||
0 commit comments