Skip to content

Commit

Permalink
RandomValues and Values return explicit types for temporal arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
burqen committed Sep 17, 2018
1 parent df2257e commit 8183f16
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
Expand Up @@ -1370,14 +1370,14 @@ public String[] nextStringArrayRaw( int minLength, int maxLength, int minStringL
} }


/** /**
* Returns the next pseudorandom {@link ArrayValue} of local-time elements. * Returns the next pseudorandom {@link LocalTimeArray} of local-time elements.
* <p> * <p>
* The length of arrays will be governed by {@link Configuration#arrayMinLength()} and * The length of arrays will be governed by {@link Configuration#arrayMinLength()} and
* {@link Configuration#arrayMaxLength()} * {@link Configuration#arrayMaxLength()}
* *
* @return the next pseudorandom {@link ArrayValue} of local-time elements. * @return the next pseudorandom {@link LocalTimeArray} of local-time elements.
*/ */
public ArrayValue nextLocalTimeArray() public LocalTimeArray nextLocalTimeArray()
{ {
LocalTime[] array = nextLocalTimeArrayRaw( minArray(), maxArray() ); LocalTime[] array = nextLocalTimeArrayRaw( minArray(), maxArray() );
return Values.localTimeArray( array ); return Values.localTimeArray( array );
Expand All @@ -1389,14 +1389,14 @@ public LocalTime[] nextLocalTimeArrayRaw( int minLength, int maxLength )
} }


/** /**
* Returns the next pseudorandom {@link ArrayValue} of time elements. * Returns the next pseudorandom {@link TimeArray} of time elements.
* <p> * <p>
* The length of arrays will be governed by {@link Configuration#arrayMinLength()} and * The length of arrays will be governed by {@link Configuration#arrayMinLength()} and
* {@link Configuration#arrayMaxLength()} * {@link Configuration#arrayMaxLength()}
* *
* @return the next pseudorandom {@link ArrayValue} of time elements. * @return the next pseudorandom {@link TimeArray} of time elements.
*/ */
public ArrayValue nextTimeArray() public TimeArray nextTimeArray()
{ {
OffsetTime[] array = nextTimeArrayRaw( minArray(), maxArray() ); OffsetTime[] array = nextTimeArrayRaw( minArray(), maxArray() );
return Values.timeArray( array ); return Values.timeArray( array );
Expand All @@ -1408,14 +1408,14 @@ public OffsetTime[] nextTimeArrayRaw( int minLength, int maxLength )
} }


/** /**
* Returns the next pseudorandom {@link ArrayValue} of local date-time elements. * Returns the next pseudorandom {@link DateTimeArray} of local date-time elements.
* <p> * <p>
* The length of arrays will be governed by {@link Configuration#arrayMinLength()} and * The length of arrays will be governed by {@link Configuration#arrayMinLength()} and
* {@link Configuration#arrayMaxLength()} * {@link Configuration#arrayMaxLength()}
* *
* @return the next pseudorandom {@link ArrayValue} of local date-time elements. * @return the next pseudorandom {@link DateTimeArray} of local date-time elements.
*/ */
public ArrayValue nextDateTimeArray() public DateTimeArray nextDateTimeArray()
{ {
ZonedDateTime[] array = nextDateTimeArrayRaw( minArray(), maxArray() ); ZonedDateTime[] array = nextDateTimeArrayRaw( minArray(), maxArray() );
return Values.dateTimeArray( array ); return Values.dateTimeArray( array );
Expand All @@ -1427,14 +1427,14 @@ public ZonedDateTime[] nextDateTimeArrayRaw( int minLength, int maxLength )
} }


/** /**
* Returns the next pseudorandom {@link ArrayValue} of local-date-time elements. * Returns the next pseudorandom {@link LocalDateTimeArray} of local-date-time elements.
* <p> * <p>
* The length of arrays will be governed by {@link Configuration#arrayMinLength()} and * The length of arrays will be governed by {@link Configuration#arrayMinLength()} and
* {@link Configuration#arrayMaxLength()} * {@link Configuration#arrayMaxLength()}
* *
* @return the next pseudorandom {@link ArrayValue} of local-date-time elements. * @return the next pseudorandom {@link LocalDateTimeArray} of local-date-time elements.
*/ */
public ArrayValue nextLocalDateTimeArray() public LocalDateTimeArray nextLocalDateTimeArray()
{ {
return Values.localDateTimeArray( nextLocalDateTimeArrayRaw( minArray(), maxArray() ) ); return Values.localDateTimeArray( nextLocalDateTimeArrayRaw( minArray(), maxArray() ) );
} }
Expand All @@ -1445,14 +1445,14 @@ public LocalDateTime[] nextLocalDateTimeArrayRaw( int minLength, int maxLength )
} }


/** /**
* Returns the next pseudorandom {@link ArrayValue} of date elements. * Returns the next pseudorandom {@link DateArray} of date elements.
* <p> * <p>
* The length of arrays will be governed by {@link Configuration#arrayMinLength()} and * The length of arrays will be governed by {@link Configuration#arrayMinLength()} and
* {@link Configuration#arrayMaxLength()} * {@link Configuration#arrayMaxLength()}
* *
* @return the next pseudorandom {@link ArrayValue} of date elements. * @return the next pseudorandom {@link DateArray} of date elements.
*/ */
public ArrayValue nextDateArray() public DateArray nextDateArray()
{ {
return Values.dateArray( nextDateArrayRaw( minArray(), maxArray() ) ); return Values.dateArray( nextDateArrayRaw( minArray(), maxArray() ) );
} }
Expand All @@ -1463,14 +1463,14 @@ public LocalDate[] nextDateArrayRaw( int minLength, int maxLength )
} }


/** /**
* Returns the next pseudorandom {@link ArrayValue} of period elements. * Returns the next pseudorandom {@link DurationArray} of period elements.
* <p> * <p>
* The length of arrays will be governed by {@link Configuration#arrayMinLength()} and * The length of arrays will be governed by {@link Configuration#arrayMinLength()} and
* {@link Configuration#arrayMaxLength()} * {@link Configuration#arrayMaxLength()}
* *
* @return the next pseudorandom {@link ArrayValue} of period elements. * @return the next pseudorandom {@link DurationArray} of period elements.
*/ */
private ArrayValue nextPeriodArray() private DurationArray nextPeriodArray()
{ {
return Values.durationArray( nextPeriodArrayRaw( minArray(), maxArray() ) ); return Values.durationArray( nextPeriodArrayRaw( minArray(), maxArray() ) );
} }
Expand All @@ -1481,14 +1481,14 @@ public Period[] nextPeriodArrayRaw( int minLength, int maxLength )
} }


/** /**
* Returns the next pseudorandom {@link ArrayValue} of duration elements. * Returns the next pseudorandom {@link DurationArray} of duration elements.
* <p> * <p>
* The length of arrays will be governed by {@link Configuration#arrayMinLength()} and * The length of arrays will be governed by {@link Configuration#arrayMinLength()} and
* {@link Configuration#arrayMaxLength()} * {@link Configuration#arrayMaxLength()}
* *
* @return the next pseudorandom {@link ArrayValue} of duration elements. * @return the next pseudorandom {@link DurationArray} of duration elements.
*/ */
public ArrayValue nextDurationArray() public DurationArray nextDurationArray()
{ {
return Values.durationArray( nextDurationArrayRaw( minArray(), maxArray() ) ); return Values.durationArray( nextDurationArrayRaw( minArray(), maxArray() ) );
} }
Expand Down
Expand Up @@ -452,37 +452,37 @@ public static DurationValue durationValue( TemporalAmount value )
return duration; return duration;
} }


public static ArrayValue dateTimeArray( ZonedDateTime[] values ) public static DateTimeArray dateTimeArray( ZonedDateTime[] values )
{ {
return new DateTimeArray( values ); return new DateTimeArray( values );
} }


public static ArrayValue localDateTimeArray( LocalDateTime[] values ) public static LocalDateTimeArray localDateTimeArray( LocalDateTime[] values )
{ {
return new LocalDateTimeArray( values ); return new LocalDateTimeArray( values );
} }


public static ArrayValue localTimeArray( LocalTime[] values ) public static LocalTimeArray localTimeArray( LocalTime[] values )
{ {
return new LocalTimeArray( values ); return new LocalTimeArray( values );
} }


public static ArrayValue timeArray( OffsetTime[] values ) public static TimeArray timeArray( OffsetTime[] values )
{ {
return new TimeArray( values ); return new TimeArray( values );
} }


public static ArrayValue dateArray( LocalDate[] values ) public static DateArray dateArray( LocalDate[] values )
{ {
return new DateArray( values ); return new DateArray( values );
} }


public static ArrayValue durationArray( DurationValue[] values ) public static DurationArray durationArray( DurationValue[] values )
{ {
return new DurationArray( values ); return new DurationArray( values );
} }


public static ArrayValue durationArray( TemporalAmount[] values ) public static DurationArray durationArray( TemporalAmount[] values )
{ {
DurationValue[] durations = new DurationValue[values.length]; DurationValue[] durations = new DurationValue[values.length];
for ( int i = 0; i < values.length; i++ ) for ( int i = 0; i < values.length; i++ )
Expand Down

0 comments on commit 8183f16

Please sign in to comment.