Interface DurationGeneratorSpec

All Superinterfaces:
GeneratorSpec<Duration>, NullableGeneratorSpec<Duration>
All Known Subinterfaces:
DurationSpec

public interface DurationGeneratorSpec extends NullableGeneratorSpec<Duration>
Generator spec for Duration.
Since:
1.5.4
  • Method Details

    • min

      DurationGeneratorSpec min(long amount, TemporalUnit unit)
      Generate a Duration greater than or equal to the specified amount.
      Parameters:
      amount - minimum duration amount (inclusive)
      unit - unit the amount is measured in
      Returns:
      spec builder
      Since:
      2.10.0
    • max

      DurationGeneratorSpec max(long amount, TemporalUnit unit)
      Generate a Duration less than or equal to the specified amount.
      Parameters:
      amount - maximum duration amount (inclusive)
      unit - unit the amount is measured in
      Returns:
      spec builder
      Since:
      2.10.0
    • of

      DurationGeneratorSpec of(long minAmount, long maxAmount, TemporalUnit unit)
      Generate a Duration in the given range, measured in specified units.
      Parameters:
      minAmount - minimum duration amount (inclusive)
      maxAmount - maximum duration amount (inclusive)
      unit - unit the amount is measured in
      Returns:
      spec builder
      Since:
      1.5.4
    • allowZero

      Allow a Duration of length zero to be generated.
      Returns:
      spec builder
      Since:
      1.5.4
    • nullable

      Indicates that null value can be generated.
      Specified by:
      nullable in interface NullableGeneratorSpec<Duration>
      Returns:
      spec builder
      Since:
      3.2.0