Java Code Examples for java.time.LocalTime#withMinute()

The following examples show how to use java.time.LocalTime#withMinute() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TCKLocalTime.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example 2
Source File: TCKLocalTime.java    From j2objc with Apache License 2.0 5 votes vote down vote up
@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);
    }
}
 
Example 3
Source File: TCKLocalTime.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example 4
Source File: TCKLocalTime.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example 5
Source File: CubaTimeField.java    From cuba with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 6
Source File: TCKLocalTime.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example 7
Source File: TCKLocalTime.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example 8
Source File: TCKLocalTime.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example 9
Source File: TCKLocalTime.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example 10
Source File: TCKLocalTime.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example 11
Source File: TCKLocalTime.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example 12
Source File: TCKLocalTime.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example 13
Source File: TCKLocalTime.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example 14
Source File: TCKLocalTime.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example 15
Source File: TCKLocalTime.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example 16
Source File: TestDateTimeFunctionsBase.java    From presto with Apache License 2.0 5 votes vote down vote up
@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));
}
 
Example 17
Source File: UseLocalTime.java    From tutorials with MIT License 4 votes vote down vote up
LocalTime getLocalTimeWithMinuteSetToValue(LocalTime localTime, int minute) {
    return localTime.withMinute(minute);
}