本文整理汇总了Java中java.time.format.SignStyle.ALWAYS属性的典型用法代码示例。如果您正苦于以下问题:Java SignStyle.ALWAYS属性的具体用法?Java SignStyle.ALWAYS怎么用?Java SignStyle.ALWAYS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.time.format.SignStyle
的用法示例。
在下文中一共展示了SignStyle.ALWAYS属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: data_signStyle
@DataProvider(name="signStyle")
Object[][] data_signStyle() {
return new Object[][] {
{LocalDate.of(0, 10, 2), SignStyle.ALWAYS, null, "+00"},
{LocalDate.of(2001, 10, 2), SignStyle.ALWAYS, null, "+2001"},
{LocalDate.of(-2001, 10, 2), SignStyle.ALWAYS, null, "-2001"},
{LocalDate.of(2001, 10, 2), SignStyle.NORMAL, null, "2001"},
{LocalDate.of(-2001, 10, 2), SignStyle.NORMAL, null, "-2001"},
{LocalDate.of(2001, 10, 2), SignStyle.NEVER, null, "2001"},
{LocalDate.of(-2001, 10, 2), SignStyle.NEVER, null, "2001"},
{LocalDate.of(2001, 10, 2), SignStyle.NOT_NEGATIVE, null, "2001"},
{LocalDate.of(-2001, 10, 2), SignStyle.NOT_NEGATIVE, DateTimeException.class, ""},
{LocalDate.of(0, 10, 2), SignStyle.EXCEEDS_PAD, null, "00"},
{LocalDate.of(1, 10, 2), SignStyle.EXCEEDS_PAD, null, "01"},
{LocalDate.of(-1, 10, 2), SignStyle.EXCEEDS_PAD, null, "-01"},
{LocalDate.of(20001, 10, 2), SignStyle.ALWAYS, DateTimeException.class, ""},
{LocalDate.of(20001, 10, 2), SignStyle.NORMAL, DateTimeException.class, ""},
{LocalDate.of(20001, 10, 2), SignStyle.NEVER, DateTimeException.class, ""},
{LocalDate.of(20001, 10, 2), SignStyle.EXCEEDS_PAD, DateTimeException.class, ""},
{LocalDate.of(20001, 10, 2), SignStyle.NOT_NEGATIVE, DateTimeException.class, ""},
};
}
示例2: provider_parseDigitsLenient
@DataProvider(name="parseDigitsLenient")
Object[][] provider_parseDigitsLenient() {
return new Object[][] {
// never
{"5", 1, 2, SignStyle.NEVER, 1, 5},
{"5", 2, 2, SignStyle.NEVER, 1, 5},
{"54", 1, 3, SignStyle.NEVER, 2, 54},
{"54", 2, 3, SignStyle.NEVER, 2, 54},
{"54", 3, 3, SignStyle.NEVER, 2, 54},
{"543", 1, 3, SignStyle.NEVER, 3, 543},
{"543", 2, 3, SignStyle.NEVER, 3, 543},
{"543", 3, 3, SignStyle.NEVER, 3, 543},
{"5432", 1, 3, SignStyle.NEVER, 4, 5432},
{"5432", 2, 3, SignStyle.NEVER, 4, 5432},
{"5432", 3, 3, SignStyle.NEVER, 4, 5432},
{"5AAA", 2, 3, SignStyle.NEVER, 1, 5},
// not negative
{"5", 1, 2, SignStyle.NOT_NEGATIVE, 1, 5},
{"5", 2, 2, SignStyle.NOT_NEGATIVE, 1, 5},
{"54", 1, 3, SignStyle.NOT_NEGATIVE, 2, 54},
{"54", 2, 3, SignStyle.NOT_NEGATIVE, 2, 54},
{"54", 3, 3, SignStyle.NOT_NEGATIVE, 2, 54},
{"543", 1, 3, SignStyle.NOT_NEGATIVE, 3, 543},
{"543", 2, 3, SignStyle.NOT_NEGATIVE, 3, 543},
{"543", 3, 3, SignStyle.NOT_NEGATIVE, 3, 543},
{"5432", 1, 3, SignStyle.NOT_NEGATIVE, 4, 5432},
{"5432", 2, 3, SignStyle.NOT_NEGATIVE, 4, 5432},
{"5432", 3, 3, SignStyle.NOT_NEGATIVE, 4, 5432},
{"5AAA", 2, 3, SignStyle.NOT_NEGATIVE, 1, 5},
// normal
{"5", 1, 2, SignStyle.NORMAL, 1, 5},
{"5", 2, 2, SignStyle.NORMAL, 1, 5},
{"54", 1, 3, SignStyle.NORMAL, 2, 54},
{"54", 2, 3, SignStyle.NORMAL, 2, 54},
{"54", 3, 3, SignStyle.NORMAL, 2, 54},
{"543", 1, 3, SignStyle.NORMAL, 3, 543},
{"543", 2, 3, SignStyle.NORMAL, 3, 543},
{"543", 3, 3, SignStyle.NORMAL, 3, 543},
{"5432", 1, 3, SignStyle.NORMAL, 4, 5432},
{"5432", 2, 3, SignStyle.NORMAL, 4, 5432},
{"5432", 3, 3, SignStyle.NORMAL, 4, 5432},
{"5AAA", 2, 3, SignStyle.NORMAL, 1, 5},
// always
{"5", 1, 2, SignStyle.ALWAYS, 1, 5},
{"5", 2, 2, SignStyle.ALWAYS, 1, 5},
{"54", 1, 3, SignStyle.ALWAYS, 2, 54},
{"54", 2, 3, SignStyle.ALWAYS, 2, 54},
{"54", 3, 3, SignStyle.ALWAYS, 2, 54},
{"543", 1, 3, SignStyle.ALWAYS, 3, 543},
{"543", 2, 3, SignStyle.ALWAYS, 3, 543},
{"543", 3, 3, SignStyle.ALWAYS, 3, 543},
{"5432", 1, 3, SignStyle.ALWAYS, 4, 5432},
{"5432", 2, 3, SignStyle.ALWAYS, 4, 5432},
{"5432", 3, 3, SignStyle.ALWAYS, 4, 5432},
{"5AAA", 2, 3, SignStyle.ALWAYS, 1, 5},
// exceeds pad
{"5", 1, 2, SignStyle.EXCEEDS_PAD, 1, 5},
{"5", 2, 2, SignStyle.EXCEEDS_PAD, 1, 5},
{"54", 1, 3, SignStyle.EXCEEDS_PAD, 2, 54},
{"54", 2, 3, SignStyle.EXCEEDS_PAD, 2, 54},
{"54", 3, 3, SignStyle.EXCEEDS_PAD, 2, 54},
{"543", 1, 3, SignStyle.EXCEEDS_PAD, 3, 543},
{"543", 2, 3, SignStyle.EXCEEDS_PAD, 3, 543},
{"543", 3, 3, SignStyle.EXCEEDS_PAD, 3, 543},
{"5432", 1, 3, SignStyle.EXCEEDS_PAD, 4, 5432},
{"5432", 2, 3, SignStyle.EXCEEDS_PAD, 4, 5432},
{"5432", 3, 3, SignStyle.EXCEEDS_PAD, 4, 5432},
{"5AAA", 2, 3, SignStyle.EXCEEDS_PAD, 1, 5},
};
}