本文整理匯總了Java中java.time.Period.ZERO屬性的典型用法代碼示例。如果您正苦於以下問題:Java Period.ZERO屬性的具體用法?Java Period.ZERO怎麽用?Java Period.ZERO使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.time.Period
的用法示例。
在下文中一共展示了Period.ZERO屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: resolvePeriod
private void resolvePeriod() {
// add whole days if we have both date and time
if (date != null && time != null && excessDays.isZero() == false) {
date = date.plus(excessDays);
excessDays = Period.ZERO;
}
}
示例2: data_toString
@DataProvider(name="toStringAndParse")
Object[][] data_toString() {
return new Object[][] {
{Period.ZERO, "P0D"},
{Period.ofDays(0), "P0D"},
{Period.ofYears(1), "P1Y"},
{Period.ofMonths(1), "P1M"},
{Period.ofDays(1), "P1D"},
{Period.of(1, 2, 0), "P1Y2M"},
{Period.of(0, 2, 3), "P2M3D"},
{Period.of(1, 2, 3), "P1Y2M3D"},
};
}
示例3: test_plus_TemporalAmount_zero
@Test
public void test_plus_TemporalAmount_zero() {
TemporalAmount period = Period.ZERO;
LocalTime t = TEST_12_30_40_987654321.plus(period);
assertEquals(t, TEST_12_30_40_987654321);
}
示例4: test_minus_TemporalAmount_zero
@Test
public void test_minus_TemporalAmount_zero() {
TemporalAmount period = Period.ZERO;
LocalTime t = TEST_12_30_40_987654321.minus(period);
assertEquals(t, TEST_12_30_40_987654321);
}