Class PersonGenerator

java.lang.Object
com.datengaertnerei.test.dataservice.person.PersonGenerator
All Implemented Interfaces:
IPersonGenerator

@Service public class PersonGenerator extends Object implements IPersonGenerator
Generates random persons
  • Constructor Details

    • PersonGenerator

      public PersonGenerator()
  • Method Details

    • init

      @PostConstruct public void init()
    • createRandomPerson

      public Person createRandomPerson(AgeRange range)
      Creates a single random person object with linked address.
      Specified by:
      createRandomPerson in interface IPersonGenerator
      Parameters:
      range - age
      Returns:
      the new person object
    • createRandomPersonInCity

      public Person createRandomPersonInCity(String city, AgeRange range)
      Creates a single random person object with linked address inside a given city.
      Specified by:
      createRandomPersonInCity in interface IPersonGenerator
      Parameters:
      city - the city to fetch random address from
      range - age
      Returns:
      the new person object
    • createRandomPersonInArea

      public Person createRandomPersonInArea(String postalCode, AgeRange range)
      Creates a single random person object with linked address inside a given postal code area.
      Specified by:
      createRandomPersonInArea in interface IPersonGenerator
      Parameters:
      postalCode - the postal code marking the area to fetch random address from
      range - age
      Returns:
      the new person object