| 3176 | |
| 3177 | // optional |
| 3178 | private static <U extends IsoUnit> Item<U> replaceFraction( |
| 3179 | long amount, |
| 3180 | U unit |
| 3181 | ) { |
| 3182 | |
| 3183 | if (unit.equals(MILLIS)) { |
| 3184 | amount = MathUtils.safeMultiply(amount, MIO); |
| 3185 | unit = cast(NANOS); |
| 3186 | } else if (unit.equals(MICROS)) { |
| 3187 | amount = MathUtils.safeMultiply(amount, 1000L); |
| 3188 | unit = cast(NANOS); |
| 3189 | } else { |
| 3190 | return null; |
| 3191 | } |
| 3192 | |
| 3193 | return Item.of(amount, unit); |
| 3194 | |
| 3195 | } |
| 3196 | |
| 3197 | private static <U extends IsoUnit> Duration<U> merge( |
| 3198 | Duration<U> duration, |