GenerateRandomPlaceValues.java 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 04 Feb 2025, Andrew Grant of Carrick Software .
  3. * All rights reserved.
  4. */
  5. package scot.carricksoftware.grantswriter;
  6. import org.springframework.stereotype.Component;
  7. import scot.carricksoftware.grantswriter.domains.places.Country;
  8. import scot.carricksoftware.grantswriter.domains.places.Place;
  9. import scot.carricksoftware.grantswriter.domains.places.Region;
  10. import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
  11. @SuppressWarnings("unused")
  12. @Component
  13. public class GenerateRandomPlaceValues {
  14. @SuppressWarnings("unused")
  15. public static Place GetRandomPlace() {
  16. Place place = new Place();
  17. place.setName(GetRandomString());
  18. place.setRegion(GetRandomRegion());
  19. return place;
  20. }
  21. public static Region GetRandomRegion() {
  22. Region region = new Region();
  23. region.setName(GetRandomString());
  24. region.setCountry(GetRandomCountry());
  25. return region;
  26. }
  27. public static Country GetRandomCountry() {
  28. Country country = new Country();
  29. country.setName(GetRandomString());
  30. return country;
  31. }
  32. }