(
T entity,
long amount
)
| 284 | //~ Methoden ------------------------------------------------------ |
| 285 | |
| 286 | @Override |
| 287 | public T addTo( |
| 288 | T entity, |
| 289 | long amount |
| 290 | ) { |
| 291 | |
| 292 | if (amount == 0) { |
| 293 | return entity; |
| 294 | } |
| 295 | |
| 296 | int yow = |
| 297 | MathUtils.safeCast( |
| 298 | MathUtils.safeAdd( |
| 299 | entity.get(YOWElement.INSTANCE).intValue(), |
| 300 | amount) |
| 301 | ); |
| 302 | |
| 303 | PlainDate date = entity.get(CALENDAR_DATE); |
| 304 | int woy = date.getWeekOfYear(); |
| 305 | Weekday dow = date.getDayOfWeek(); |
| 306 | |
| 307 | if (woy == 53) { |
| 308 | PlainDate test = PlainDate.of(yow, 26, dow); |
| 309 | woy = test.getMaximum(Weekmodel.ISO.weekOfYear()); |
| 310 | } |
| 311 | |
| 312 | return entity.with( |
| 313 | CALENDAR_DATE, |
| 314 | PlainDate.of(yow, woy, dow)); |
| 315 | |
| 316 | } |
| 317 | |
| 318 | @Override |
| 319 | public long between( |
nothing calls this directly
no test coverage detected