DurationTest.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:openjdk-jdk10 作者:
@DataProvider(name = "duration-field")
public Object[][] getDurationAndField() {
    Function<Duration, Integer> getyears = duration -> duration.getYears();
    Function<Duration, Integer> getmonths = duration -> duration.getMonths();
    Function<Duration, Integer> getdays = duration -> duration.getDays();
    Function<Duration, Integer> gethours = duration -> duration.getHours();
    Function<Duration, Integer> getminutes = duration -> duration.getMinutes();
    Function<Duration, Integer> getseconds = duration -> duration.getSeconds();
    return new Object[][] {
            { "P1Y1M1DT1H1M1S", getyears, 1 },
            { "P1M1DT1H1M1S", getyears, 0 },
            { "P1Y1M1DT1H1M1S", getmonths, 1 },
            { "P1Y1DT1H1M1S", getmonths, 0 },
            { "P1Y1M1DT1H1M1S", getdays, 1 },
            { "P1Y1MT1H1M1S", getdays, 0 },
            { "P1Y1M1DT1H1M1S", gethours, 1 },
            { "P1Y1M1DT1M1S", gethours, 0 },
            { "P1Y1M1DT1H1M1S", getminutes, 1 },
            { "P1Y1M1DT1H1S", getminutes, 0 },
            { "P1Y1M1DT1H1M1S", getseconds, 1 },
            { "P1Y1M1DT1H1M", getseconds, 0 },
            { "P1Y1M1DT1H1M100000000S", getseconds, 100000000 }, };
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号