本文整理汇总了Java中java.time.chrono.MinguoDate.with方法的典型用法代码示例。如果您正苦于以下问题:Java MinguoDate.with方法的具体用法?Java MinguoDate.with怎么用?Java MinguoDate.with使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.time.chrono.MinguoDate
的用法示例。
在下文中一共展示了MinguoDate.with方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test_adjust1
import java.time.chrono.MinguoDate; //导入方法依赖的package包/类
@Test
public void test_adjust1() {
MinguoDate base = MinguoChronology.INSTANCE.date(2012, 10, 29);
MinguoDate test = base.with(TemporalAdjusters.lastDayOfMonth());
assertEquals(test, MinguoChronology.INSTANCE.date(2012, 10, 31));
}
示例2: test_adjust2
import java.time.chrono.MinguoDate; //导入方法依赖的package包/类
@Test
public void test_adjust2() {
MinguoDate base = MinguoChronology.INSTANCE.date(1728, 12, 2);
MinguoDate test = base.with(TemporalAdjusters.lastDayOfMonth());
assertEquals(test, MinguoChronology.INSTANCE.date(1728, 12, 31));
}
示例3: test_adjust_toLocalDate
import java.time.chrono.MinguoDate; //导入方法依赖的package包/类
@Test
public void test_adjust_toLocalDate() {
MinguoDate minguo = MinguoChronology.INSTANCE.date(99, 1, 4);
MinguoDate test = minguo.with(LocalDate.of(2012, 7, 6));
assertEquals(test, MinguoChronology.INSTANCE.date(101, 7, 6));
}
示例4: test_adjust_toMonth
import java.time.chrono.MinguoDate; //导入方法依赖的package包/类
@Test(expectedExceptions=DateTimeException.class)
public void test_adjust_toMonth() {
MinguoDate minguo = MinguoChronology.INSTANCE.date(1726, 1, 4);
minguo.with(Month.APRIL);
}