java.lang.Object
com.pholser.junit.quickcheck.generator.Generator<Year>
com.pholser.junit.quickcheck.generator.java.time.YearGenerator
All Implemented Interfaces:
Gen<Year>, Shrink<Year>

public class YearGenerator extends Generator<Year>
Produces values of type Year.
  • Field Details

    • min

      private Year min
    • max

      private Year max
  • Constructor Details

    • YearGenerator

      public YearGenerator()
  • Method Details

    • configure

      public void configure(InRange range)

      Tells this generator to produce values within a specified minimum and/or maximum, inclusive, with uniform distribution.

      If an endpoint of the range is not specified, the generator will use Years with values of either Year#MIN_VALUE or Year#MAX_VALUE as appropriate.

      InRange.format() describes how the generator is to interpret the range's endpoints.

      Parameters:
      range - annotation that gives the range's constraints
    • generate

      public Year generate(SourceOfRandomness random, GenerationStatus status)
      Description copied from interface: Gen
      Generates a value, possibly influenced by a source of randomness and metadata about the generation.
      Parameters:
      random - source of randomness to be used when generating the value
      status - an object that can be used to influence the generated value. For example, generating lists can use the size method to generate lists with a given number of elements.
      Returns:
      the generated value