本文整理匯總了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},
};
}