本文整理汇总了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);
}