1.0.0-RC3 #21

Merged
ZhouXY108 merged 11 commits from 1.x.x into dev 2025-02-14 19:03:05 +08:00
2 changed files with 2 additions and 25 deletions
Showing only changes of commit 669506e499 - Show all commits

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2024 the original author or authors. * Copyright 2024-2025 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -281,14 +281,6 @@ public final class YearQuarter implements Comparable<YearQuarter>, Serializable
return this.compareTo(other) > 0; return this.compareTo(other) > 0;
} }
public static YearQuarter min(YearQuarter yearQuarter1, YearQuarter yearQuarter2) {
return yearQuarter1.compareTo(yearQuarter2) <= 0 ? yearQuarter1 : yearQuarter2;
}
public static YearQuarter max(YearQuarter yearQuarter1, YearQuarter yearQuarter2) {
return yearQuarter1.compareTo(yearQuarter2) >= 0 ? yearQuarter1 : yearQuarter2;
}
// #endregion // #endregion
// #region - toString // #region - toString

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2024 the original author or authors. * Copyright 2024-2025 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -1173,19 +1173,4 @@ public class YearQuarterTests {
} }
} }
} }
@ParameterizedTest
@ValueSource(ints = { -1, 0, 1, 1900, 2000, 2023, 2024, Year.MAX_VALUE, Year.MIN_VALUE })
void test_min_And_max_sameYear(int year) {
YearQuarter yq1 = YearQuarter.of(year, 1);
YearQuarter anotherYq1 = YearQuarter.of(year, 1);
assertEquals(yq1, YearQuarter.max(yq1, anotherYq1));
assertEquals(yq1, YearQuarter.min(yq1, anotherYq1));
YearQuarter yq2 = YearQuarter.of(year, 2);
assertEquals(yq2, YearQuarter.max(yq1, yq2));
assertEquals(yq1, YearQuarter.min(yq1, yq2));
}
} }