java.time.temporal.ValueRange Java Examples
The following examples show how to use
java.time.temporal.ValueRange.
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: AbstractChronology.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
ChronoLocalDate resolveYMD(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) { int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); if (resolverStyle == ResolverStyle.LENIENT) { long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); long days = Math.subtractExact(fieldValues.remove(DAY_OF_MONTH), 1); return date(y, 1, 1).plus(months, MONTHS).plus(days, DAYS); } int moy = range(MONTH_OF_YEAR).checkValidIntValue(fieldValues.remove(MONTH_OF_YEAR), MONTH_OF_YEAR); ValueRange domRange = range(DAY_OF_MONTH); int dom = domRange.checkValidIntValue(fieldValues.remove(DAY_OF_MONTH), DAY_OF_MONTH); if (resolverStyle == ResolverStyle.SMART) { // previous valid try { return date(y, moy, dom); } catch (DateTimeException ex) { return date(y, moy, 1).with(TemporalAdjusters.lastDayOfMonth()); } } return date(y, moy, dom); }
Example #2
Source File: HijrahDate.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
@Override public ValueRange range(TemporalField field) { if (field instanceof ChronoField) { if (isSupported(field)) { ChronoField f = (ChronoField) field; switch (f) { case DAY_OF_MONTH: return ValueRange.of(1, lengthOfMonth()); case DAY_OF_YEAR: return ValueRange.of(1, lengthOfYear()); case ALIGNED_WEEK_OF_MONTH: return ValueRange.of(1, 5); // TODO // TODO does the limited range of valid years cause years to // start/end part way through? that would affect range } return getChronology().range(f); } throw new UnsupportedTemporalTypeException("Unsupported field: " + field); } return field.rangeRefinedBy(this); }
Example #3
Source File: JapaneseDate.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
@Override public ValueRange range(TemporalField field) { if (field instanceof ChronoField) { if (isSupported(field)) { ChronoField f = (ChronoField) field; switch (f) { case DAY_OF_MONTH: return ValueRange.of(1, lengthOfMonth()); case DAY_OF_YEAR: return ValueRange.of(1, lengthOfYear()); case YEAR_OF_ERA: { Calendar jcal = Calendar.getInstance(JapaneseChronology.LOCALE); jcal.set(Calendar.ERA, era.getValue() + JapaneseEra.ERA_OFFSET); jcal.set(yearOfEra, isoDate.getMonthValue() - 1, isoDate.getDayOfMonth()); return ValueRange.of(1, jcal.getActualMaximum(Calendar.YEAR)); } } return getChronology().range(f); } throw new UnsupportedTemporalTypeException("Unsupported field: " + field); } return field.rangeRefinedBy(this); }
Example #4
Source File: TCKWeekFields.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
@Test(dataProvider="weekFields") public void test_rangeWeekOfWeekBasedYear(DayOfWeek firstDayOfWeek, int minDays) { WeekFields weekFields = WeekFields.of(firstDayOfWeek, minDays); TemporalField dowField = weekFields.dayOfWeek(); TemporalField wowByField = weekFields.weekOfWeekBasedYear(); LocalDate day1 = LocalDate.of(2012, 1, weekFields.getMinimalDaysInFirstWeek()); day1 = day1.with(wowByField, 1).with(dowField, 1); LocalDate day2 = LocalDate.of(2013, 1, weekFields.getMinimalDaysInFirstWeek()); day2 = day2.with(wowByField, 1).with(dowField, 1); int expectedWeeks = (int)ChronoUnit.DAYS.between(day1, day2) / 7; ValueRange range = day1.range(wowByField); assertEquals(range.getMaximum(), expectedWeeks, "Range incorrect"); }
Example #5
Source File: JapaneseDate.java From JDKSourceCode1.8 with MIT License | 6 votes |
@Override public ValueRange range(TemporalField field) { if (field instanceof ChronoField) { if (isSupported(field)) { ChronoField f = (ChronoField) field; switch (f) { case DAY_OF_MONTH: return ValueRange.of(1, lengthOfMonth()); case DAY_OF_YEAR: return ValueRange.of(1, lengthOfYear()); case YEAR_OF_ERA: { Calendar jcal = Calendar.getInstance(JapaneseChronology.LOCALE); jcal.set(Calendar.ERA, era.getValue() + JapaneseEra.ERA_OFFSET); jcal.set(yearOfEra, isoDate.getMonthValue() - 1, isoDate.getDayOfMonth()); return ValueRange.of(1, jcal.getActualMaximum(Calendar.YEAR)); } } return getChronology().range(f); } throw new UnsupportedTemporalTypeException("Unsupported field: " + field); } return field.rangeRefinedBy(this); }
Example #6
Source File: ChronoPeriodImpl.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Calculates the range of months. * * @return the month range, -1 if not fixed range */ private long monthRange() { ValueRange startRange = chrono.range(MONTH_OF_YEAR); if (startRange.isFixed() && startRange.isIntValue()) { return startRange.getMaximum() - startRange.getMinimum() + 1; } return -1; }
Example #7
Source File: TestDateTimeValueRange.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider="valid") public void test_of_checkValidValue(long sMin, long lMin, long sMax, long lMax) { ValueRange test = ValueRange.of(sMin, lMin, sMax, lMax); assertEquals(test.checkValidIntValue(sMin, null), sMin); assertEquals(test.checkValidIntValue(lMin, null), lMin); assertEquals(test.checkValidIntValue(sMax, null), sMax); assertEquals(test.checkValidIntValue(lMax, null), lMax); }
Example #8
Source File: TestUmmAlQuraChronology.java From hottub with GNU General Public License v2.0 | 5 votes |
@Test (dataProvider="monthDays") public void test_valueRange_monthDays(int year, int month, int maxlength) { ChronoLocalDate date = HijrahChronology.INSTANCE.date(year, month, 1); ValueRange range = null; for (int i=1; i<=12; i++) { range = date.range(ChronoField.DAY_OF_MONTH); date = date.plus(1, ChronoUnit.MONTHS); assertEquals(range.getMaximum(), month, maxlength); } }
Example #9
Source File: TestUmmAlQuraChronology.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider="dates") public void Test_UmmAlQuraRanges(HijrahDate date, int minYear, int maxYear, int minMonth, int maxMonth, int minDay, int maxDay, int maxChronoDay) { // Check the chronology ranges HijrahChronology chrono = date.getChronology(); ValueRange yearRange = chrono.range(YEAR); assertEquals(yearRange.getMinimum(), minYear, "Minimum year for Hijrah chronology"); assertEquals(yearRange.getLargestMinimum(), minYear, "Largest minimum year for Hijrah chronology"); assertEquals(yearRange.getMaximum(), maxYear, "Maximum year for Hijrah chronology"); assertEquals(yearRange.getSmallestMaximum(), maxYear, "Smallest Maximum year for Hijrah chronology"); ValueRange monthRange = chrono.range(MONTH_OF_YEAR); assertEquals(monthRange.getMinimum(), minMonth, "Minimum month for Hijrah chronology"); assertEquals(monthRange.getMaximum(), maxMonth, "Maximum month for Hijrah chronology"); ValueRange daysRange = chrono.range(DAY_OF_MONTH); assertEquals(daysRange.getMinimum(), minDay, "Minimum day for chronology"); assertEquals(daysRange.getMaximum(), maxChronoDay, "Maximum day for Hijrah chronology"); // Check the date ranges yearRange = date.range(YEAR); assertEquals(yearRange.getMinimum(), minYear, "Minimum year for Hijrah date"); assertEquals(yearRange.getLargestMinimum(), minYear, "Largest minimum year for Hijrah date"); assertEquals(yearRange.getMaximum(), maxYear, "Maximum year for Hijrah date"); assertEquals(yearRange.getSmallestMaximum(), maxYear, "Smallest maximum year for Hijrah date"); monthRange = date.range(MONTH_OF_YEAR); assertEquals(monthRange.getMinimum(), minMonth, "Minimum month for HijrahDate"); assertEquals(monthRange.getMaximum(), maxMonth, "Maximum month for HijrahDate"); daysRange = date.range(DAY_OF_MONTH); assertEquals(daysRange.getMinimum(), minDay, "Minimum day for HijrahDate"); assertEquals(daysRange.getMaximum(), maxDay, "Maximum day for HijrahDate"); }
Example #10
Source File: TestDateTimeValueRange.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public void test_equals1() { ValueRange a = ValueRange.of(1, 2, 3, 4); ValueRange b = ValueRange.of(1, 2, 3, 4); assertEquals(a.equals(a), true); assertEquals(a.equals(b), true); assertEquals(b.equals(a), true); assertEquals(b.equals(b), true); assertEquals(a.hashCode() == b.hashCode(), true); }
Example #11
Source File: TestUmmAlQuraChronology.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider="dates") public void Test_UmmAlQuraRanges(HijrahDate date, int minYear, int maxYear, int minMonth, int maxMonth, int minDay, int maxDay, int maxChronoDay) { // Check the chronology ranges HijrahChronology chrono = date.getChronology(); ValueRange yearRange = chrono.range(YEAR); assertEquals(yearRange.getMinimum(), minYear, "Minimum year for Hijrah chronology"); assertEquals(yearRange.getLargestMinimum(), minYear, "Largest minimum year for Hijrah chronology"); assertEquals(yearRange.getMaximum(), maxYear, "Maximum year for Hijrah chronology"); assertEquals(yearRange.getSmallestMaximum(), maxYear, "Smallest Maximum year for Hijrah chronology"); ValueRange monthRange = chrono.range(MONTH_OF_YEAR); assertEquals(monthRange.getMinimum(), minMonth, "Minimum month for Hijrah chronology"); assertEquals(monthRange.getMaximum(), maxMonth, "Maximum month for Hijrah chronology"); ValueRange daysRange = chrono.range(DAY_OF_MONTH); assertEquals(daysRange.getMinimum(), minDay, "Minimum day for chronology"); assertEquals(daysRange.getMaximum(), maxChronoDay, "Maximum day for Hijrah chronology"); // Check the date ranges yearRange = date.range(YEAR); assertEquals(yearRange.getMinimum(), minYear, "Minimum year for Hijrah date"); assertEquals(yearRange.getLargestMinimum(), minYear, "Largest minimum year for Hijrah date"); assertEquals(yearRange.getMaximum(), maxYear, "Maximum year for Hijrah date"); assertEquals(yearRange.getSmallestMaximum(), maxYear, "Smallest maximum year for Hijrah date"); monthRange = date.range(MONTH_OF_YEAR); assertEquals(monthRange.getMinimum(), minMonth, "Minimum month for HijrahDate"); assertEquals(monthRange.getMaximum(), maxMonth, "Maximum month for HijrahDate"); daysRange = date.range(DAY_OF_MONTH); assertEquals(daysRange.getMinimum(), minDay, "Minimum day for HijrahDate"); assertEquals(daysRange.getMaximum(), maxDay, "Maximum day for HijrahDate"); }
Example #12
Source File: TCKWeekFields.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider="weekFields") public void test_fieldRanges(DayOfWeek firstDayOfWeek, int minDays) { WeekFields weekDef = WeekFields.of(firstDayOfWeek, minDays); TemporalField womField = weekDef.weekOfMonth(); TemporalField woyField = weekDef.weekOfYear(); LocalDate day = LocalDate.of(2012, 11, 30); LocalDate endDay = LocalDate.of(2013, 1, 2); while (day.isBefore(endDay)) { LocalDate last = day.with(DAY_OF_MONTH, day.lengthOfMonth()); int lastWOM = last.get(womField); LocalDate first = day.with(DAY_OF_MONTH, 1); int firstWOM = first.get(womField); ValueRange rangeWOM = day.range(womField); assertEquals(rangeWOM.getMinimum(), firstWOM, "Range min should be same as WeekOfMonth for first day of month: " + first + ", " + weekDef); assertEquals(rangeWOM.getMaximum(), lastWOM, "Range max should be same as WeekOfMonth for last day of month: " + last + ", " + weekDef); last = day.with(DAY_OF_YEAR, day.lengthOfYear()); int lastWOY = last.get(woyField); first = day.with(DAY_OF_YEAR, 1); int firstWOY = first.get(woyField); ValueRange rangeWOY = day.range(woyField); assertEquals(rangeWOY.getMinimum(), firstWOY, "Range min should be same as WeekOfYear for first day of Year: " + day + ", " + weekDef); assertEquals(rangeWOY.getMaximum(), lastWOY, "Range max should be same as WeekOfYear for last day of Year: " + day + ", " + weekDef); day = day.plusDays(1); } }
Example #13
Source File: CopticChronology.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Override public ValueRange range(ChronoField field) { switch (field) { case DAY_OF_MONTH: return ValueRange.of(1, 5, 30); case ALIGNED_WEEK_OF_MONTH: return ValueRange.of(1, 1, 5); case MONTH_OF_YEAR: return ValueRange.of(1, 13); case PROLEPTIC_MONTH: return ValueRange.of(-1000, 1000); // TODO case YEAR_OF_ERA: return ValueRange.of(1, 999, 1000); // TODO case YEAR: return ValueRange.of(-1000, 1000); // TODO } return field.range(); }
Example #14
Source File: TestDateTimeValueRange.java From j2objc with Apache License 2.0 | 5 votes |
@Test public void test_of_longlong_big() { ValueRange test = ValueRange.of(1, 123456789012345L); assertEquals(test.getMinimum(), 1); assertEquals(test.getLargestMinimum(), 1); assertEquals(test.getSmallestMaximum(), 123456789012345L); assertEquals(test.getMaximum(), 123456789012345L); assertEquals(test.isFixed(), true); assertEquals(test.isIntValue(), false); }
Example #15
Source File: TestIsoWeekFields.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "fields") public void test_WOWBY_rangeRefinedBy(TemporalField weekField, TemporalField yearField) { assertEquals(weekField.rangeRefinedBy(LocalDate.of(2012, 12, 31)), ValueRange.of(1, 52)); assertEquals(weekField.rangeRefinedBy(LocalDate.of(2013, 12, 29)), ValueRange.of(1, 52)); assertEquals(weekField.rangeRefinedBy(LocalDate.of(2013, 12, 30)), ValueRange.of(1, 52)); assertEquals(weekField.rangeRefinedBy(LocalDate.of(2014, 12, 28)), ValueRange.of(1, 52)); assertEquals(weekField.rangeRefinedBy(LocalDate.of(2014, 12, 29)), ValueRange.of(1, 53)); assertEquals(weekField.rangeRefinedBy(LocalDate.of(2016, 1, 3)), ValueRange.of(1, 53)); assertEquals(weekField.rangeRefinedBy(LocalDate.of(2016, 1, 4)), ValueRange.of(1, 52)); }
Example #16
Source File: TestDateTimeValueRange.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider="valid") public void test_of_checkValidValue(long sMin, long lMin, long sMax, long lMax) { ValueRange test = ValueRange.of(sMin, lMin, sMax, lMax); assertEquals(test.checkValidIntValue(sMin, null), sMin); assertEquals(test.checkValidIntValue(lMin, null), lMin); assertEquals(test.checkValidIntValue(sMax, null), sMax); assertEquals(test.checkValidIntValue(lMax, null), lMax); }
Example #17
Source File: MockFieldValue.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
@Override public ValueRange range(TemporalField field) { if (field instanceof ChronoField) { if (isSupported(field)) { return field.range(); } throw new UnsupportedTemporalTypeException("Unsupported field: " + field); } return field.rangeRefinedBy(this); }
Example #18
Source File: TCKIsoFields.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@DataProvider(name="isofields") Object[][] data_isofields() { return new Object[][] { {IsoFields.DAY_OF_QUARTER, 49, ValueRange.of(1, 91)}, {IsoFields.QUARTER_OF_YEAR, 2, ValueRange.of(1, 4)}, {IsoFields.WEEK_OF_WEEK_BASED_YEAR, 20, ValueRange.of(1, 52)}, {IsoFields.WEEK_BASED_YEAR, 2016, ValueRange.of(LocalDate.MIN.getYear(), LocalDate.MAX.getYear())}, }; }
Example #19
Source File: ChronoZonedDateTime.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Override default ValueRange range(TemporalField field) { if (field instanceof ChronoField) { if (field == INSTANT_SECONDS || field == OFFSET_SECONDS) { return field.range(); } return toLocalDateTime().range(field); } return field.rangeRefinedBy(this); }
Example #20
Source File: ChronoLocalDateImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private long monthsUntil(ChronoLocalDate end) { ValueRange range = getChronology().range(MONTH_OF_YEAR); if (range.getMaximum() != 12) { throw new IllegalStateException("ChronoLocalDateImpl only supports Chronologies with 12 months per year"); } long packed1 = getLong(PROLEPTIC_MONTH) * 32L + get(DAY_OF_MONTH); // no overflow long packed2 = end.getLong(PROLEPTIC_MONTH) * 32L + end.get(DAY_OF_MONTH); // no overflow return (packed2 - packed1) / 32; }
Example #21
Source File: TestDateTimeValueRange.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public void test_of_longlong() { ValueRange test = ValueRange.of(1, 12); assertEquals(test.getMinimum(), 1); assertEquals(test.getLargestMinimum(), 1); assertEquals(test.getSmallestMaximum(), 12); assertEquals(test.getMaximum(), 12); assertEquals(test.isFixed(), true); assertEquals(test.isIntValue(), true); }
Example #22
Source File: TCKChronoField.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
@Test public void test_range() { assertEquals(MONTH_OF_YEAR.range(), ValueRange.of(1, 12)); assertEquals(MONTH_OF_YEAR.rangeRefinedBy(LocalDate.of(2000, 2, 29)), ValueRange.of(1, 12)); assertEquals(DAY_OF_MONTH.range(), ValueRange.of(1, 28, 31)); assertEquals(DAY_OF_MONTH.rangeRefinedBy(LocalDate.of(2000, 2, 29)), ValueRange.of(1, 29)); }
Example #23
Source File: TestUmmAlQuraChronology.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@Test (dataProvider="monthDays") public void test_valueRange_monthDays(int year, int month, int maxlength) { ChronoLocalDate date = HijrahChronology.INSTANCE.date(year, month, 1); ValueRange range = null; for (int i=1; i<=12; i++) { range = date.range(ChronoField.DAY_OF_MONTH); date = date.plus(1, ChronoUnit.MONTHS); assertEquals(range.getMaximum(), month, maxlength); } }
Example #24
Source File: TCKChronoField.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Test public void test_range() { assertEquals(MONTH_OF_YEAR.range(), ValueRange.of(1, 12)); assertEquals(MONTH_OF_YEAR.rangeRefinedBy(LocalDate.of(2000, 2, 29)), ValueRange.of(1, 12)); assertEquals(DAY_OF_MONTH.range(), ValueRange.of(1, 28, 31)); assertEquals(DAY_OF_MONTH.rangeRefinedBy(LocalDate.of(2000, 2, 29)), ValueRange.of(1, 29)); }
Example #25
Source File: TestDateTimeValueRange.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public void test_of_longlonglong() { ValueRange test = ValueRange.of(1, 28, 31); assertEquals(test.getMinimum(), 1); assertEquals(test.getLargestMinimum(), 1); assertEquals(test.getSmallestMaximum(), 28); assertEquals(test.getMaximum(), 31); assertEquals(test.isFixed(), false); assertEquals(test.isIntValue(), true); }
Example #26
Source File: TCKThaiBuddhistChronology.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test public void test_Chrono_range() { long minYear = LocalDate.MIN.getYear() + YDIFF; long maxYear = LocalDate.MAX.getYear() + YDIFF; assertEquals(ThaiBuddhistChronology.INSTANCE.range(YEAR), ValueRange.of(minYear, maxYear)); assertEquals(ThaiBuddhistChronology.INSTANCE.range(YEAR_OF_ERA), ValueRange.of(1, -minYear + 1, maxYear)); assertEquals(ThaiBuddhistChronology.INSTANCE.range(DAY_OF_MONTH), DAY_OF_MONTH.range()); assertEquals(ThaiBuddhistChronology.INSTANCE.range(DAY_OF_YEAR), DAY_OF_YEAR.range()); assertEquals(ThaiBuddhistChronology.INSTANCE.range(MONTH_OF_YEAR), MONTH_OF_YEAR.range()); }
Example #27
Source File: TestDateTimeValueRange.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public void test_equals1() { ValueRange a = ValueRange.of(1, 2, 3, 4); ValueRange b = ValueRange.of(1, 2, 3, 4); assertEquals(a.equals(a), true); assertEquals(a.equals(b), true); assertEquals(b.equals(a), true); assertEquals(b.equals(b), true); assertEquals(a.hashCode() == b.hashCode(), true); }
Example #28
Source File: TCKThaiBuddhistChronology.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
@Test public void test_Chrono_range() { long minYear = LocalDate.MIN.getYear() + YDIFF; long maxYear = LocalDate.MAX.getYear() + YDIFF; assertEquals(ThaiBuddhistChronology.INSTANCE.range(YEAR), ValueRange.of(minYear, maxYear)); assertEquals(ThaiBuddhistChronology.INSTANCE.range(YEAR_OF_ERA), ValueRange.of(1, -minYear + 1, maxYear)); assertEquals(ThaiBuddhistChronology.INSTANCE.range(DAY_OF_MONTH), DAY_OF_MONTH.range()); assertEquals(ThaiBuddhistChronology.INSTANCE.range(DAY_OF_YEAR), DAY_OF_YEAR.range()); assertEquals(ThaiBuddhistChronology.INSTANCE.range(MONTH_OF_YEAR), MONTH_OF_YEAR.range()); }
Example #29
Source File: TestIsoWeekFields.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "fields") public void test_WOWBY_rangeRefinedBy(TemporalField weekField, TemporalField yearField) { assertEquals(weekField.rangeRefinedBy(LocalDate.of(2012, 12, 31)), ValueRange.of(1, 52)); assertEquals(weekField.rangeRefinedBy(LocalDate.of(2013, 12, 29)), ValueRange.of(1, 52)); assertEquals(weekField.rangeRefinedBy(LocalDate.of(2013, 12, 30)), ValueRange.of(1, 52)); assertEquals(weekField.rangeRefinedBy(LocalDate.of(2014, 12, 28)), ValueRange.of(1, 52)); assertEquals(weekField.rangeRefinedBy(LocalDate.of(2014, 12, 29)), ValueRange.of(1, 53)); assertEquals(weekField.rangeRefinedBy(LocalDate.of(2016, 1, 3)), ValueRange.of(1, 53)); assertEquals(weekField.rangeRefinedBy(LocalDate.of(2016, 1, 4)), ValueRange.of(1, 52)); }
Example #30
Source File: TestDateTimeValueRange.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public void test_isValidValue_long_int() { ValueRange test = ValueRange.of(1, 28, 31); assertEquals(test.isValidValue(0), false); assertEquals(test.isValidValue(1), true); assertEquals(test.isValidValue(31), true); assertEquals(test.isValidValue(32), false); }