|
31 | 31 | import org.checkerframework.checker.nullness.qual.NonNull; |
32 | 32 |
|
33 | 33 | import java.math.BigDecimal; |
| 34 | +import java.math.RoundingMode; |
34 | 35 | import java.sql.Date; |
35 | 36 | import java.sql.Time; |
36 | 37 | import java.sql.Timestamp; |
@@ -76,142 +77,142 @@ static IntervalSecondType.IntervalSecond mul(String value0, IntervalSecondType.I |
76 | 77 | } |
77 | 78 |
|
78 | 79 | static IntervalYearType.IntervalYear mul(Integer value0, IntervalYearType.IntervalYear value1) { |
79 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 80 | + BigDecimal decimal = new BigDecimal(value0); |
80 | 81 | return (IntervalYearType.IntervalYear) buildInterval(decimal, value1); |
81 | 82 | } |
82 | 83 |
|
83 | 84 | static IntervalMonthType.IntervalMonth mul(Integer value0, IntervalMonthType.IntervalMonth value1) { |
84 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 85 | + BigDecimal decimal = new BigDecimal(value0); |
85 | 86 | return (IntervalMonthType.IntervalMonth) buildInterval(decimal, value1); |
86 | 87 | } |
87 | 88 |
|
88 | 89 | static IntervalDayType.IntervalDay mul(Integer value0, IntervalDayType.IntervalDay value1) { |
89 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 90 | + BigDecimal decimal = new BigDecimal(value0); |
90 | 91 | return (IntervalDayType.IntervalDay) buildInterval(decimal, value1); |
91 | 92 | } |
92 | 93 |
|
93 | 94 | static IntervalWeekType.IntervalWeek mul(Integer value0, IntervalWeekType.IntervalWeek value1) { |
94 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 95 | + BigDecimal decimal = new BigDecimal(value0); |
95 | 96 | return (IntervalWeekType.IntervalWeek) buildInterval(decimal, value1); |
96 | 97 | } |
97 | 98 |
|
98 | 99 | static IntervalHourType.IntervalHour mul(Integer value0, IntervalHourType.IntervalHour value1) { |
99 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 100 | + BigDecimal decimal = new BigDecimal(value0); |
100 | 101 | return (IntervalHourType.IntervalHour) buildInterval(decimal, value1); |
101 | 102 | } |
102 | 103 |
|
103 | 104 | static IntervalMinuteType.IntervalMinute mul(Integer value0, IntervalMinuteType.IntervalMinute value1) { |
104 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 105 | + BigDecimal decimal = new BigDecimal(value0); |
105 | 106 | return (IntervalMinuteType.IntervalMinute) buildInterval(decimal, value1); |
106 | 107 | } |
107 | 108 |
|
108 | 109 | static IntervalSecondType.IntervalSecond mul(Integer value0, IntervalSecondType.IntervalSecond value1) { |
109 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 110 | + BigDecimal decimal = new BigDecimal(value0); |
110 | 111 | return (IntervalSecondType.IntervalSecond) buildInterval(decimal, value1); |
111 | 112 | } |
112 | 113 |
|
113 | 114 | static IntervalYearType.IntervalYear mul(Long value0, IntervalYearType.IntervalYear value1) { |
114 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 115 | + BigDecimal decimal = new BigDecimal(value0); |
115 | 116 | return (IntervalYearType.IntervalYear) buildInterval(decimal, value1); |
116 | 117 | } |
117 | 118 |
|
118 | 119 | static IntervalMonthType.IntervalMonth mul(Long value0, IntervalMonthType.IntervalMonth value1) { |
119 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 120 | + BigDecimal decimal = new BigDecimal(value0); |
120 | 121 | return (IntervalMonthType.IntervalMonth) buildInterval(decimal, value1); |
121 | 122 | } |
122 | 123 |
|
123 | 124 | static IntervalDayType.IntervalDay mul(Long value0, IntervalDayType.IntervalDay value1) { |
124 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 125 | + BigDecimal decimal = new BigDecimal(value0); |
125 | 126 | return (IntervalDayType.IntervalDay) buildInterval(decimal, value1); |
126 | 127 | } |
127 | 128 |
|
128 | 129 | static IntervalWeekType.IntervalWeek mul(Long value0, IntervalWeekType.IntervalWeek value1) { |
129 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 130 | + BigDecimal decimal = new BigDecimal(value0); |
130 | 131 | return (IntervalWeekType.IntervalWeek) buildInterval(decimal, value1); |
131 | 132 | } |
132 | 133 |
|
133 | 134 | static IntervalHourType.IntervalHour mul(Long value0, IntervalHourType.IntervalHour value1) { |
134 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 135 | + BigDecimal decimal = new BigDecimal(value0); |
135 | 136 | return (IntervalHourType.IntervalHour) buildInterval(decimal, value1); |
136 | 137 | } |
137 | 138 |
|
138 | 139 | static IntervalMinuteType.IntervalMinute mul(Long value0, IntervalMinuteType.IntervalMinute value1) { |
139 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 140 | + BigDecimal decimal = new BigDecimal(value0); |
140 | 141 | return (IntervalMinuteType.IntervalMinute) buildInterval(decimal, value1); |
141 | 142 | } |
142 | 143 |
|
143 | 144 | static IntervalSecondType.IntervalSecond mul(Long value0, IntervalSecondType.IntervalSecond value1) { |
144 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 145 | + BigDecimal decimal = new BigDecimal(value0); |
145 | 146 | return (IntervalSecondType.IntervalSecond) buildInterval(decimal, value1); |
146 | 147 | } |
147 | 148 |
|
148 | 149 | static IntervalYearType.IntervalYear mul(Double value0, IntervalYearType.IntervalYear value1) { |
149 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 150 | + BigDecimal decimal = new BigDecimal(Math.round(value0)); |
150 | 151 | return (IntervalYearType.IntervalYear) buildInterval(decimal, value1); |
151 | 152 | } |
152 | 153 |
|
153 | 154 | static IntervalMonthType.IntervalMonth mul(Double value0, IntervalMonthType.IntervalMonth value1) { |
154 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 155 | + BigDecimal decimal = new BigDecimal(Math.round(value0)); |
155 | 156 | return (IntervalMonthType.IntervalMonth) buildInterval(decimal, value1); |
156 | 157 | } |
157 | 158 |
|
158 | 159 | static IntervalDayType.IntervalDay mul(Double value0, IntervalDayType.IntervalDay value1) { |
159 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 160 | + BigDecimal decimal = new BigDecimal(Math.round(value0)); |
160 | 161 | return (IntervalDayType.IntervalDay) buildInterval(decimal, value1); |
161 | 162 | } |
162 | 163 |
|
163 | 164 | static IntervalWeekType.IntervalWeek mul(Double value0, IntervalWeekType.IntervalWeek value1) { |
164 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 165 | + BigDecimal decimal = new BigDecimal(Math.round(value0)); |
165 | 166 | return (IntervalWeekType.IntervalWeek) buildInterval(decimal, value1); |
166 | 167 | } |
167 | 168 |
|
168 | 169 | static IntervalHourType.IntervalHour mul(Double value0, IntervalHourType.IntervalHour value1) { |
169 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 170 | + BigDecimal decimal = new BigDecimal(Math.round(value0)); |
170 | 171 | return (IntervalHourType.IntervalHour) buildInterval(decimal, value1); |
171 | 172 | } |
172 | 173 |
|
173 | 174 | static IntervalMinuteType.IntervalMinute mul(Double value0, IntervalMinuteType.IntervalMinute value1) { |
174 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 175 | + BigDecimal decimal = new BigDecimal(Math.round(value0)); |
175 | 176 | return (IntervalMinuteType.IntervalMinute) buildInterval(decimal, value1); |
176 | 177 | } |
177 | 178 |
|
178 | 179 | static IntervalSecondType.IntervalSecond mul(Double value0, IntervalSecondType.IntervalSecond value1) { |
179 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 180 | + BigDecimal decimal = new BigDecimal(Math.round(value0)); |
180 | 181 | return (IntervalSecondType.IntervalSecond) buildInterval(decimal, value1); |
181 | 182 | } |
182 | 183 |
|
183 | 184 | static IntervalYearType.IntervalYear mul(Float value0, IntervalYearType.IntervalYear value1) { |
184 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 185 | + BigDecimal decimal = new BigDecimal(Math.round(value0)); |
185 | 186 | return (IntervalYearType.IntervalYear) buildInterval(decimal, value1); |
186 | 187 | } |
187 | 188 |
|
188 | 189 | static IntervalMonthType.IntervalMonth mul(Float value0, IntervalMonthType.IntervalMonth value1) { |
189 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 190 | + BigDecimal decimal = new BigDecimal(Math.round(value0)); |
190 | 191 | return (IntervalMonthType.IntervalMonth) buildInterval(decimal, value1); |
191 | 192 | } |
192 | 193 |
|
193 | 194 | static IntervalDayType.IntervalDay mul(Float value0, IntervalDayType.IntervalDay value1) { |
194 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 195 | + BigDecimal decimal = new BigDecimal(Math.round(value0)); |
195 | 196 | return (IntervalDayType.IntervalDay) buildInterval(decimal, value1); |
196 | 197 | } |
197 | 198 |
|
198 | 199 | static IntervalWeekType.IntervalWeek mul(Float value0, IntervalWeekType.IntervalWeek value1) { |
199 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 200 | + BigDecimal decimal = new BigDecimal(Math.round(value0)); |
200 | 201 | return (IntervalWeekType.IntervalWeek) buildInterval(decimal, value1); |
201 | 202 | } |
202 | 203 |
|
203 | 204 | static IntervalHourType.IntervalHour mul(Float value0, IntervalHourType.IntervalHour value1) { |
204 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 205 | + BigDecimal decimal = new BigDecimal(Math.round(value0)); |
205 | 206 | return (IntervalHourType.IntervalHour) buildInterval(decimal, value1); |
206 | 207 | } |
207 | 208 |
|
208 | 209 | static IntervalMinuteType.IntervalMinute mul(Float value0, IntervalMinuteType.IntervalMinute value1) { |
209 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 210 | + BigDecimal decimal = new BigDecimal(Math.round(value0)); |
210 | 211 | return (IntervalMinuteType.IntervalMinute) buildInterval(decimal, value1); |
211 | 212 | } |
212 | 213 |
|
213 | 214 | static IntervalSecondType.IntervalSecond mul(Float value0, IntervalSecondType.IntervalSecond value1) { |
214 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 215 | + BigDecimal decimal = new BigDecimal(Math.round(value0)); |
215 | 216 | return (IntervalSecondType.IntervalSecond) buildInterval(decimal, value1); |
216 | 217 | } |
217 | 218 |
|
@@ -251,37 +252,37 @@ static IntervalSecondType.IntervalSecond mul(Boolean value0, IntervalSecondType. |
251 | 252 | } |
252 | 253 |
|
253 | 254 | static IntervalYearType.IntervalYear mul(BigDecimal value0, IntervalYearType.IntervalYear value1) { |
254 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 255 | + BigDecimal decimal = value0.setScale(0, RoundingMode.HALF_UP); |
255 | 256 | return (IntervalYearType.IntervalYear) buildInterval(decimal, value1); |
256 | 257 | } |
257 | 258 |
|
258 | 259 | static IntervalMonthType.IntervalMonth mul(BigDecimal value0, IntervalMonthType.IntervalMonth value1) { |
259 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 260 | + BigDecimal decimal = value0.setScale(0, RoundingMode.HALF_UP); |
260 | 261 | return (IntervalMonthType.IntervalMonth) buildInterval(decimal, value1); |
261 | 262 | } |
262 | 263 |
|
263 | 264 | static IntervalDayType.IntervalDay mul(BigDecimal value0, IntervalDayType.IntervalDay value1) { |
264 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 265 | + BigDecimal decimal = value0.setScale(0, RoundingMode.HALF_UP); |
265 | 266 | return (IntervalDayType.IntervalDay) buildInterval(decimal, value1); |
266 | 267 | } |
267 | 268 |
|
268 | 269 | static IntervalWeekType.IntervalWeek mul(BigDecimal value0, IntervalWeekType.IntervalWeek value1) { |
269 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 270 | + BigDecimal decimal = value0.setScale(0, RoundingMode.HALF_UP); |
270 | 271 | return (IntervalWeekType.IntervalWeek) buildInterval(decimal, value1); |
271 | 272 | } |
272 | 273 |
|
273 | 274 | static IntervalHourType.IntervalHour mul(BigDecimal value0, IntervalHourType.IntervalHour value1) { |
274 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 275 | + BigDecimal decimal = value0.setScale(0, RoundingMode.HALF_UP); |
275 | 276 | return (IntervalHourType.IntervalHour) buildInterval(decimal, value1); |
276 | 277 | } |
277 | 278 |
|
278 | 279 | static IntervalMinuteType.IntervalMinute mul(BigDecimal value0, IntervalMinuteType.IntervalMinute value1) { |
279 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 280 | + BigDecimal decimal = value0.setScale(0, RoundingMode.HALF_UP); |
280 | 281 | return (IntervalMinuteType.IntervalMinute) buildInterval(decimal, value1); |
281 | 282 | } |
282 | 283 |
|
283 | 284 | static IntervalSecondType.IntervalSecond mul(BigDecimal value0, IntervalSecondType.IntervalSecond value1) { |
284 | | - BigDecimal decimal = new BigDecimal(Math.round(CastWithString.doubleCastWithStringCompat(value0.toString()))); |
| 285 | + BigDecimal decimal = value0.setScale(0, RoundingMode.HALF_UP); |
285 | 286 | return (IntervalSecondType.IntervalSecond) buildInterval(decimal, value1); |
286 | 287 | } |
287 | 288 |
|
|
0 commit comments