java.time.Duration.getUnits()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(151)

本文整理了Java中java.time.Duration.getUnits()方法的一些代码示例,展示了Duration.getUnits()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Duration.getUnits()方法的具体详情如下:
包路径:java.time.Duration
类名称:Duration
方法名:getUnits

Duration.getUnits介绍

暂无

代码示例

代码示例来源:origin: zeebe-io/zeebe

public Interval(Period period, Duration duration) {
 this.period = period;
 this.duration = duration;
 this.units = new ArrayList<>();
 this.units.addAll(period.getUnits());
 this.units.addAll(duration.getUnits());
}

代码示例来源:origin: metatron-app/metatron-discovery

@Override
public List<TemporalUnit> getUnits() {
 return Stream.concat(period.getUnits().stream(), duration.getUnits().stream())
        .collect(Collectors.toList());
}

代码示例来源:origin: com.palantir.conjure.java.api/service-config

@Override
public List<TemporalUnit> getUnits() {
  return toJavaDuration().getUnits();
}

代码示例来源:origin: io.zeebe/zb-bpmn-model

public Interval(Period period, Duration duration) {
 this.period = period;
 this.duration = duration;
 this.units = new ArrayList<>();
 this.units.addAll(period.getUnits());
 this.units.addAll(duration.getUnits());
}

代码示例来源:origin: io.ratpack/ratpack-test

try {
 if (!latch.await(timeout.toNanos(), TimeUnit.NANOSECONDS)) {
  TemporalUnit unit = timeout.getUnits().get(0);
  throw new IllegalStateException("Request to " + uri + " took more than " + timeout.get(unit) + " " + unit.toString() + " to complete");

相关文章