Commit cbe13d2
authored
fix(types): restore LLMProvider source compatibility for the 7-arg primitive shape (#151)
Code-review finding on PR #148: the new 13-arg boxed constructor
replaced the public 7-arg primitive shape, and getPriority() /
getWeight() changed from `int` to `Integer`. That's a real breaking
change in a PR framed as additive — pre-existing callers either
fail to compile (constructor) or now see nullable return values
where they expected primitives (accessors).
This PR preserves source compatibility while keeping the boxed
storage that the wire-shape contract needs:
1. Add a 7-arg primitive constructor that delegates to the new
13-arg one with nulls for the post-PR-#148 optional fields.
Marked @deprecated to nudge new callers toward the boxed form.
2. getPriority() and getWeight() return primitive `int` again
(null-safe-unbox to 0). Boxed access is via the new
getPriorityBoxed() / getWeightBoxed() methods.
3. getEnabled() (which was BRAND NEW in PR #148, returning
Boolean) is renamed to getEnabledBoxed() so the JavaBeans-style
name doesn't lure callers into `boolean e = p.getEnabled()`
and an NPE on null. Pre-PR-#148 had no getEnabled() so this
rename has no consumers.
4. Same Boxed-suffix pattern applied to getHasApiKey →
getHasApiKeyBoxed for symmetry; primitive `boolean hasApiKey()`
was already there from before #148.
Two new regression tests pin the source-compat shape:
- llmProviderLegacyConstructorPreservesSourceCompat — exercises
the 7-arg primitive constructor and confirms primitive-returning
accessors round-trip correctly.
- llmProviderPrimitiveAccessorsNullSafe — confirms primitive
accessors null-safe-unbox to 0 / false when the boxed field is
null (which is what Jackson produces when the JSON field is
omitted).
Existing test that asserted on `p.getEnabled()` updated to
`p.getEnabledBoxed()` to match the new naming.
Wire-shape baseline refreshed — the renamed getter is not part of
the wire contract (Jackson reads via constructor), but the validator
records SDK class shape and noticed the rename. No spec drift.1 parent e3808b1 commit cbe13d2
3 files changed
Lines changed: 159 additions & 19 deletions
File tree
- src
- main/java/com/getaxonflow/sdk/types
- test/java/com/getaxonflow/sdk
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
Lines changed: 102 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
33 | 43 | | |
34 | 44 | | |
35 | 45 | | |
| |||
48 | 58 | | |
49 | 59 | | |
50 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
51 | 66 | | |
52 | 67 | | |
53 | 68 | | |
| |||
77 | 92 | | |
78 | 93 | | |
79 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
80 | 125 | | |
81 | 126 | | |
82 | 127 | | |
| |||
85 | 130 | | |
86 | 131 | | |
87 | 132 | | |
88 | | - | |
89 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
90 | 148 | | |
91 | 149 | | |
92 | 150 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
96 | 158 | | |
97 | 159 | | |
98 | | - | |
99 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
100 | 165 | | |
101 | 166 | | |
102 | 167 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
106 | 175 | | |
107 | 176 | | |
108 | | - | |
109 | | - | |
110 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
111 | 183 | | |
112 | 184 | | |
113 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
114 | 190 | | |
115 | 191 | | |
116 | 192 | | |
117 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
118 | 202 | | |
119 | 203 | | |
120 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
801 | 801 | | |
802 | 802 | | |
803 | 803 | | |
804 | | - | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
805 | 807 | | |
806 | 808 | | |
807 | 809 | | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
808 | 863 | | |
809 | 864 | | |
810 | 865 | | |
| |||
0 commit comments