MCPcopy Create free account
hub / github.com/MenoData/Time4J / ofClockUnits

Method ofClockUnits

base/src/main/java/net/time4j/Duration.java:551–573  ·  view source on GitHub ↗
(
        int hours,
        int minutes,
        int seconds
    )

Source from the content-addressed store, hash-verified

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>

Calls 2

ofMethod · 0.95
addMethod · 0.45