private LocalDateTimeValue randomLocalDateTime() { return random.randomValues().nextLocalDateTimeValue(); }
/** * Returns a randomly selected temporal value spread uniformly over the supported types. * * @return a randomly selected temporal value */ public Value nextTemporalValue() { int nextInt = generator.nextInt( 6 ); switch ( nextInt ) { case 0: return nextDateValue(); case 1: return nextLocalDateTimeValue(); case 2: return nextDateTimeValue(); case 3: return nextLocalTimeValue(); case 4: return nextTimeValue(); case 5: return nextDuration(); default: throw new IllegalArgumentException( nextInt + " not a valid temporal type" ); } }
@Test public void testIndexRangeSeekByLocalDateTime() throws Exception { testIndexRangeSeek( () -> random.randomValues().nextLocalDateTimeValue() ); }
return nextBasicMultilingualPlaneTextValue(); case LOCAL_DATE_TIME: return nextLocalDateTimeValue(); case DATE: return nextDateValue();
() -> random.randomValues().nextLocalDateTimeValue(), () -> random.randomValues().nextDateValue(), () -> random.randomValues().nextTimeValue(),
/** * Returns a randomly selected temporal value spread uniformly over the supported types. * * @return a randomly selected temporal value */ public Value nextTemporalValue() { int nextInt = generator.nextInt( 6 ); switch ( nextInt ) { case 0: return nextDateValue(); case 1: return nextLocalDateTimeValue(); case 2: return nextDateTimeValue(); case 3: return nextLocalTimeValue(); case 4: return nextTimeValue(); case 5: return nextDuration(); default: throw new IllegalArgumentException( nextInt + " not a valid temporal type" ); } }
return nextBasicMultilingualPlaneTextValue(); case LOCAL_DATE_TIME: return nextLocalDateTimeValue(); case DATE: return nextDateValue();