| 549 | * @see #inverse() |
| 550 | */ |
| 551 | public static Duration<ClockUnit> ofClockUnits( |
| 552 | int hours, |
| 553 | int minutes, |
| 554 | int seconds |
| 555 | ) { |
| 556 | |
| 557 | List<Item<ClockUnit>> items = new ArrayList<>(3); |
| 558 | |
| 559 | if (hours != 0) { |
| 560 | items.add(Item.of(hours, HOURS)); |
| 561 | } |
| 562 | |
| 563 | if (minutes != 0) { |
| 564 | items.add(Item.of(minutes, MINUTES)); |
| 565 | } |
| 566 | |
| 567 | if (seconds != 0) { |
| 568 | items.add(Item.of(seconds, SECONDS)); |
| 569 | } |
| 570 | |
| 571 | return new Duration<>(items, false); |
| 572 | |
| 573 | } |
| 574 | |
| 575 | /** |
| 576 | * <p>Tries to convert given temporal amount to a duration. </p> |