下面列出了java.time.LocalTime#withMinute ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Test
public void testTruncateTime()
{
LocalTime result = TIME;
result = result.withNano(0);
assertFunction("date_trunc('second', " + TIME_LITERAL + ")", TimeType.TIME, toTime(result));
result = result.withSecond(0);
assertFunction("date_trunc('minute', " + TIME_LITERAL + ")", TimeType.TIME, toTime(result));
result = result.withMinute(0);
assertFunction("date_trunc('hour', " + TIME_LITERAL + ")", TimeType.TIME, toTime(result));
}
@Test
public void test_withMinute_normal() {
LocalTime t = TEST_12_30_40_987654321;
for (int i = 0; i < 60; i++) {
t = t.withMinute(i);
assertEquals(t.getMinute(), i);
}
}
@Test
public void test_withMinute_normal() {
LocalTime t = TEST_12_30_40_987654321;
for (int i = 0; i < 60; i++) {
t = t.withMinute(i);
assertEquals(t.getMinute(), i);
}
}
@Test
public void test_withMinute_normal() {
LocalTime t = TEST_12_30_40_987654321;
for (int i = 0; i < 60; i++) {
t = t.withMinute(i);
assertEquals(t.getMinute(), i);
}
}
@Test
public void test_withMinute_normal() {
LocalTime t = TEST_12_30_40_987654321;
for (int i = 0; i < 60; i++) {
t = t.withMinute(i);
assertEquals(t.getMinute(), i);
}
}
@Test
public void test_withMinute_normal() {
LocalTime t = TEST_12_30_40_987654321;
for (int i = 0; i < 60; i++) {
t = t.withMinute(i);
assertEquals(t.getMinute(), i);
}
}
@Test
public void test_withMinute_normal() {
LocalTime t = TEST_12_30_40_987654321;
for (int i = 0; i < 60; i++) {
t = t.withMinute(i);
assertEquals(t.getMinute(), i);
}
}
@Test
public void test_withMinute_normal() {
LocalTime t = TEST_12_30_40_987654321;
for (int i = 0; i < 60; i++) {
t = t.withMinute(i);
assertEquals(t.getMinute(), i);
}
}
@Test
public void test_withMinute_normal() {
LocalTime t = TEST_12_30_40_987654321;
for (int i = 0; i < 60; i++) {
t = t.withMinute(i);
assertEquals(t.getMinute(), i);
}
}
@Test
public void test_withMinute_normal() {
LocalTime t = TEST_12_30_40_987654321;
for (int i = 0; i < 60; i++) {
t = t.withMinute(i);
assertEquals(t.getMinute(), i);
}
}
@Test
public void test_withMinute_normal() {
LocalTime t = TEST_12_30_40_987654321;
for (int i = 0; i < 60; i++) {
t = t.withMinute(i);
assertEquals(t.getMinute(), i);
}
}
@Test
public void test_withMinute_normal() {
LocalTime t = TEST_12_30_40_987654321;
for (int i = 0; i < 60; i++) {
t = t.withMinute(i);
assertEquals(t.getMinute(), i);
}
}
protected LocalTime applyResolutionToValue(LocalTime value) {
if (value == null) {
return null;
}
LocalTime result = LocalTime.MIDNIGHT;
List<TimeResolution> resolutions = getResolutionsHigherOrEqualTo(getResolution())
.collect(Collectors.toList());
for (TimeResolution resolution : resolutions) {
switch (resolution) {
case HOUR:
result = result.withHour(value.getHour());
break;
case MINUTE:
result = result.withMinute(value.getMinute());
break;
case SECOND:
result = result.withSecond(value.getSecond());
break;
default:
throw new IllegalArgumentException("Cannot detect resolution type");
}
}
return result;
}
@Test
public void test_withMinute_normal() {
LocalTime t = TEST_12_30_40_987654321;
for (int i = 0; i < 60; i++) {
t = t.withMinute(i);
assertEquals(t.getMinute(), i);
}
}
@Test
public void test_withMinute_normal() {
LocalTime t = TEST_12_30_40_987654321;
for (int i = 0; i < 60; i++) {
t = t.withMinute(i);
assertEquals(t.getMinute(), i);
}
}
@Test
public void test_withMinute_normal() {
LocalTime t = TEST_12_30_40_987654321;
for (int i = 0; i < 60; i++) {
t = t.withMinute(i);
assertEquals(t.getMinute(), i);
}
}
LocalTime getLocalTimeWithMinuteSetToValue(LocalTime localTime, int minute) {
return localTime.withMinute(minute);
}