Java Code Examples for java.time.LocalDateTime#MIN

The following examples show how to use java.time.LocalDateTime#MIN . 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: TCKLocalDateTime.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="adjustInto")
Object[][] data_adjustInto() {
    return new Object[][]{
            {LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.of(2012, 3, 4, 1, 1, 1, 100), LocalDateTime.of(2012, 3, 4, 23, 5, 0, 0), null},
            {LocalDateTime.of(2012, Month.MARCH, 4, 0, 0), LocalDateTime.of(2012, 3, 4, 1, 1, 1, 100), LocalDateTime.of(2012, 3, 4, 0, 0), null},
            {LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MAX, LocalDateTime.of(2012, 3, 4, 23, 5), null},
            {LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MIN, LocalDateTime.of(2012, 3, 4, 23, 5), null},
            {LocalDateTime.MAX, LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MAX, null},
            {LocalDateTime.MIN, LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MIN, null},

            {LocalDateTime.of(2012, 3, 4, 23, 5), OffsetDateTime.of(2210, 2, 2, 0, 0, 0, 0, ZoneOffset.UTC), OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, ZoneOffset.UTC), null},
            {LocalDateTime.of(2012, 3, 4, 23, 5), OffsetDateTime.of(2210, 2, 2, 0, 0, 0, 0, OFFSET_PONE), OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), null},
            {LocalDateTime.of(2012, 3, 4, 23, 5), ZonedDateTime.of(2210, 2, 2, 0, 0, 0, 0, ZONE_PARIS), ZonedDateTime.of(2012, 3, 4, 23, 5, 0, 0, ZONE_PARIS), null},

            {LocalDateTime.of(2012, 3, 4, 23, 5), LocalDate.of(2210, 2, 2), null, DateTimeException.class},
            {LocalDateTime.of(2012, 3, 4, 23, 5), LocalTime.of(22, 3, 0), null, DateTimeException.class},
            {LocalDateTime.of(2012, 3, 4, 23, 5), OffsetTime.of(22, 3, 0, 0, ZoneOffset.UTC), null, DateTimeException.class},
            {LocalDateTime.of(2012, 3, 4, 23, 5), null, null, NullPointerException.class},

    };
}
 
Example 2
Source File: TCKLocalDateTime.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="adjustInto")
Object[][] data_adjustInto() {
    return new Object[][]{
            {LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.of(2012, 3, 4, 1, 1, 1, 100), LocalDateTime.of(2012, 3, 4, 23, 5, 0, 0), null},
            {LocalDateTime.of(2012, Month.MARCH, 4, 0, 0), LocalDateTime.of(2012, 3, 4, 1, 1, 1, 100), LocalDateTime.of(2012, 3, 4, 0, 0), null},
            {LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MAX, LocalDateTime.of(2012, 3, 4, 23, 5), null},
            {LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MIN, LocalDateTime.of(2012, 3, 4, 23, 5), null},
            {LocalDateTime.MAX, LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MAX, null},
            {LocalDateTime.MIN, LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MIN, null},

            {LocalDateTime.of(2012, 3, 4, 23, 5), OffsetDateTime.of(2210, 2, 2, 0, 0, 0, 0, ZoneOffset.UTC), OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, ZoneOffset.UTC), null},
            {LocalDateTime.of(2012, 3, 4, 23, 5), OffsetDateTime.of(2210, 2, 2, 0, 0, 0, 0, OFFSET_PONE), OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), null},
            {LocalDateTime.of(2012, 3, 4, 23, 5), ZonedDateTime.of(2210, 2, 2, 0, 0, 0, 0, ZONE_PARIS), ZonedDateTime.of(2012, 3, 4, 23, 5, 0, 0, ZONE_PARIS), null},

            {LocalDateTime.of(2012, 3, 4, 23, 5), LocalDate.of(2210, 2, 2), null, DateTimeException.class},
            {LocalDateTime.of(2012, 3, 4, 23, 5), LocalTime.of(22, 3, 0), null, DateTimeException.class},
            {LocalDateTime.of(2012, 3, 4, 23, 5), OffsetTime.of(22, 3, 0, 0, ZoneOffset.UTC), null, DateTimeException.class},
            {LocalDateTime.of(2012, 3, 4, 23, 5), null, null, NullPointerException.class},

    };
}
 
Example 3
Source File: TCKLocalDateTime.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="adjustInto")
Object[][] data_adjustInto() {
    return new Object[][]{
            {LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.of(2012, 3, 4, 1, 1, 1, 100), LocalDateTime.of(2012, 3, 4, 23, 5, 0, 0), null},
            {LocalDateTime.of(2012, Month.MARCH, 4, 0, 0), LocalDateTime.of(2012, 3, 4, 1, 1, 1, 100), LocalDateTime.of(2012, 3, 4, 0, 0), null},
            {LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MAX, LocalDateTime.of(2012, 3, 4, 23, 5), null},
            {LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MIN, LocalDateTime.of(2012, 3, 4, 23, 5), null},
            {LocalDateTime.MAX, LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MAX, null},
            {LocalDateTime.MIN, LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MIN, null},

            {LocalDateTime.of(2012, 3, 4, 23, 5), OffsetDateTime.of(2210, 2, 2, 0, 0, 0, 0, ZoneOffset.UTC), OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, ZoneOffset.UTC), null},
            {LocalDateTime.of(2012, 3, 4, 23, 5), OffsetDateTime.of(2210, 2, 2, 0, 0, 0, 0, OFFSET_PONE), OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), null},
            {LocalDateTime.of(2012, 3, 4, 23, 5), ZonedDateTime.of(2210, 2, 2, 0, 0, 0, 0, ZONE_PARIS), ZonedDateTime.of(2012, 3, 4, 23, 5, 0, 0, ZONE_PARIS), null},

            {LocalDateTime.of(2012, 3, 4, 23, 5), LocalDate.of(2210, 2, 2), null, DateTimeException.class},
            {LocalDateTime.of(2012, 3, 4, 23, 5), LocalTime.of(22, 3, 0), null, DateTimeException.class},
            {LocalDateTime.of(2012, 3, 4, 23, 5), OffsetTime.of(22, 3, 0, 0, ZoneOffset.UTC), null, DateTimeException.class},
            {LocalDateTime.of(2012, 3, 4, 23, 5), null, null, NullPointerException.class},

    };
}
 
Example 4
Source File: TCKLocalDateTime.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@BeforeMethod
public void setUp() {
    MAX_DATE_TIME = LocalDateTime.MAX;
    MIN_DATE_TIME = LocalDateTime.MIN;
    MAX_INSTANT = MAX_DATE_TIME.atZone(ZoneOffset.UTC).toInstant();
    MIN_INSTANT = MIN_DATE_TIME.atZone(ZoneOffset.UTC).toInstant();
}
 
Example 5
Source File: FindingsView.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public int compare(Viewer viewer, Object e1, Object e2){
	IFinding p1 = (IFinding) e1;
	IFinding p2 = (IFinding) e2;
	int rc = 0;
	switch (propertyIndex) {
	case 0:
	case 1:
		LocalDateTime t1 = LocalDateTime.MIN;
		LocalDateTime t2 = LocalDateTime.MIN;
		if (p1 instanceof IObservation) {
			t1 = ((IObservation) p1).getEffectiveTime().orElse(LocalDateTime.MIN);
		}
		if (p2 instanceof IObservation) {
			t2 = ((IObservation) p2).getEffectiveTime().orElse(LocalDateTime.MIN);
		}
		rc = t1.compareTo(t2);
		break;
	case 2:
		String txt1 = p1.getText().orElse("");
		String txt2 = p2.getText().orElse("");
		rc = txt1.toLowerCase().compareTo(txt2.toLowerCase());
		break;
	default:
		rc = 0;
	}
	// If descending order, flip the direction
	if (direction == DESCENDING) {
		rc = -rc;
	}
	return rc;
}
 
Example 6
Source File: TCKLocalDateTime.java    From j2objc with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
    MAX_DATE_TIME = LocalDateTime.MAX;
    MIN_DATE_TIME = LocalDateTime.MIN;
    MAX_INSTANT = MAX_DATE_TIME.atZone(ZoneOffset.UTC).toInstant();
    MIN_INSTANT = MIN_DATE_TIME.atZone(ZoneOffset.UTC).toInstant();
}
 
Example 7
Source File: Race.java    From hazelcast-jet-demos with Apache License 2.0 5 votes vote down vote up
private RaceDetails(long ID) {
    id = ID;
    odds = new HashMap<>();
    raceTime = LocalDateTime.MIN;
    version = 1;
    winner = Optional.empty();
}
 
Example 8
Source File: TCKLocalDateTime.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@BeforeMethod
public void setUp() {
    MAX_DATE_TIME = LocalDateTime.MAX;
    MIN_DATE_TIME = LocalDateTime.MIN;
    MAX_INSTANT = MAX_DATE_TIME.atZone(ZoneOffset.UTC).toInstant();
    MIN_INSTANT = MIN_DATE_TIME.atZone(ZoneOffset.UTC).toInstant();
}
 
Example 9
Source File: TCKLocalDateTime.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@BeforeMethod
public void setUp() {
    MAX_DATE_TIME = LocalDateTime.MAX;
    MIN_DATE_TIME = LocalDateTime.MIN;
    MAX_INSTANT = MAX_DATE_TIME.atZone(ZoneOffset.UTC).toInstant();
    MIN_INSTANT = MIN_DATE_TIME.atZone(ZoneOffset.UTC).toInstant();
}
 
Example 10
Source File: ProtoParquetWriterWithOffsetTest.java    From garmadon with Apache License 2.0 5 votes vote down vote up
@Test(expected = IOException.class)
public void closeWithNoEvent() throws IOException {
    final ProtoParquetWriter<Message> writerMock = mock(ProtoParquetWriter.class);
    final BiConsumer<String, String> protoMetadataWriter = mock(BiConsumer.class);

    final ProtoParquetWriterWithOffset parquetWriter = new ProtoParquetWriterWithOffset<>(writerMock,
        createTmpFile(), finalPath, localFs, new HdfsOffsetComputer(localFs, finalPath, 2), LocalDateTime.MIN, "ignored",
        protoMetadataWriter, 0);

    parquetWriter.close();
}
 
Example 11
Source File: TCKLocalDateTime.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@BeforeMethod
public void setUp() {
    MAX_DATE_TIME = LocalDateTime.MAX;
    MIN_DATE_TIME = LocalDateTime.MIN;
    MAX_INSTANT = MAX_DATE_TIME.atZone(ZoneOffset.UTC).toInstant();
    MIN_INSTANT = MIN_DATE_TIME.atZone(ZoneOffset.UTC).toInstant();
}
 
Example 12
Source File: TCKLocalDateTime.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@BeforeMethod
public void setUp() {
    MAX_DATE_TIME = LocalDateTime.MAX;
    MIN_DATE_TIME = LocalDateTime.MIN;
    MAX_INSTANT = MAX_DATE_TIME.atZone(ZoneOffset.UTC).toInstant();
    MIN_INSTANT = MIN_DATE_TIME.atZone(ZoneOffset.UTC).toInstant();
}
 
Example 13
Source File: TCKLocalDateTime.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected List<TemporalAccessor> samples() {
    TemporalAccessor[] array = {TEST_2007_07_15_12_30_40_987654321, LocalDateTime.MAX, LocalDateTime.MIN, };
    return Arrays.asList(array);
}
 
Example 14
Source File: TCKLocalDateTime.java    From j2objc with Apache License 2.0 4 votes vote down vote up
@Override
protected List<TemporalAccessor> samples() {
    TemporalAccessor[] array = {TEST_2007_07_15_12_30_40_987654321, LocalDateTime.MAX, LocalDateTime.MIN, };
    return Arrays.asList(array);
}
 
Example 15
Source File: TCKLocalDateTime.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected List<TemporalAccessor> samples() {
    TemporalAccessor[] array = {TEST_2007_07_15_12_30_40_987654321, LocalDateTime.MAX, LocalDateTime.MIN, };
    return Arrays.asList(array);
}
 
Example 16
Source File: TCKLocalDateTime.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected List<TemporalAccessor> samples() {
    TemporalAccessor[] array = {TEST_2007_07_15_12_30_40_987654321, LocalDateTime.MAX, LocalDateTime.MIN, };
    return Arrays.asList(array);
}
 
Example 17
Source File: TCKLocalDateTime.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected List<TemporalAccessor> samples() {
    TemporalAccessor[] array = {TEST_2007_07_15_12_30_40_987654321, LocalDateTime.MAX, LocalDateTime.MIN, };
    return Arrays.asList(array);
}
 
Example 18
Source File: LocalDateTimeRangeRandomizer.java    From easy-random with MIT License 4 votes vote down vote up
@Override
protected LocalDateTime getDefaultMinValue() {
    return LocalDateTime.MIN;
}
 
Example 19
Source File: TCKLocalDateTime.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected List<TemporalAccessor> samples() {
    TemporalAccessor[] array = {TEST_2007_07_15_12_30_40_987654321, LocalDateTime.MAX, LocalDateTime.MIN, };
    return Arrays.asList(array);
}
 
Example 20
Source File: TCKLocalDateTime.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected List<TemporalAccessor> samples() {
    TemporalAccessor[] array = {TEST_2007_07_15_12_30_40_987654321, LocalDateTime.MAX, LocalDateTime.MIN, };
    return Arrays.asList(array);
}