本文整理汇总了Java中java.time.temporal.ChronoUnit.MILLENNIA属性的典型用法代码示例。如果您正苦于以下问题:Java ChronoUnit.MILLENNIA属性的具体用法?Java ChronoUnit.MILLENNIA怎么用?Java ChronoUnit.MILLENNIA使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.time.temporal.ChronoUnit
的用法示例。
在下文中一共展示了ChronoUnit.MILLENNIA属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: provider_factory_of_badTemporalUnit
@DataProvider(name="BadTemporalUnit")
Object[][] provider_factory_of_badTemporalUnit() {
return new Object[][] {
{0, MICROS},
{0, MILLIS},
{0, MINUTES},
{0, HOURS},
{0, HALF_DAYS},
{0, DAYS},
{0, ChronoUnit.MONTHS},
{0, ChronoUnit.YEARS},
{0, ChronoUnit.DECADES},
{0, ChronoUnit.CENTURIES},
{0, ChronoUnit.MILLENNIA},
};
}
示例2: getChildChronoUnit
/**
* Returns the child ChronoUnit for the given ChronoUnit.
*
* @param chronoUnit desired ChronoUnit
* @return child ChronoUnit of the given ChronoUnit
*/
@NotNull
public static ChronoUnit getChildChronoUnit(@NotNull ChronoUnit chronoUnit) {
switch (requireNonNull(chronoUnit)) {
case MICROS:
return ChronoUnit.NANOS;
case MILLIS:
return ChronoUnit.MICROS;
case SECONDS:
return ChronoUnit.MILLIS;
case MINUTES:
return ChronoUnit.SECONDS;
case HOURS:
return ChronoUnit.MINUTES;
case DAYS:
return ChronoUnit.HOURS;
case WEEKS:
return ChronoUnit.DAYS;
case MONTHS:
return ChronoUnit.WEEKS;
case YEARS:
return ChronoUnit.MONTHS;
case DECADES:
return ChronoUnit.YEARS;
case MILLENNIA:
return ChronoUnit.DECADES;
case ERAS:
return ChronoUnit.MILLENNIA;
default:
throw new UnsupportedOperationException("Unsupported chrono unit: " + chronoUnit);
}
}
示例3: data_badTemporalUnit
@DataProvider(name="BadTemporalUnit")
Object[][] data_badTemporalUnit() {
return new Object[][] {
{ChronoUnit.MICROS},
{ChronoUnit.MILLIS},
{ChronoUnit.HALF_DAYS},
{ChronoUnit.DECADES},
{ChronoUnit.CENTURIES},
{ChronoUnit.MILLENNIA},
};
}