Class RandomAddressExtensions


  • public final class RandomAddressExtensions
    extends java.lang.Object
    The class RandomAddressExtensions is a utility class to create random addresses.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PROP_FILE_STREETS
      Resource for get german streets.
      static java.lang.String PROP_FILE_ZIP_CITIES
      Resource for get german zipcodes and the cities from it.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getRandomStreet​(java.util.Properties properties)
      Returns a random german street.
      static java.lang.String getRandomStreetWithNumber​(java.util.Properties properties)
      Gets a random german street with a random number.
      static java.lang.String getRandomZip​(java.util.Properties properties)
      Gets a random zip from the Properties.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PROP_FILE_STREETS

        public static final java.lang.String PROP_FILE_STREETS
        Resource for get german streets.
        See Also:
        Constant Field Values
      • PROP_FILE_ZIP_CITIES

        public static final java.lang.String PROP_FILE_ZIP_CITIES
        Resource for get german zipcodes and the cities from it.
        See Also:
        Constant Field Values
    • Method Detail

      • getRandomStreet

        public static java.lang.String getRandomStreet​(java.util.Properties properties)
                                                throws java.io.IOException
        Returns a random german street.
        Parameters:
        properties - The properties file with the streets.
        Returns:
        A random german street.
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • getRandomStreetWithNumber

        public static java.lang.String getRandomStreetWithNumber​(java.util.Properties properties)
                                                          throws java.io.IOException
        Gets a random german street with a random number.
        Parameters:
        properties - The properties file with the streets.
        Returns:
        Returns a random german street with a random number.
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • getRandomZip

        public static java.lang.String getRandomZip​(java.util.Properties properties)
        Gets a random zip from the Properties.
        Parameters:
        properties - The Properties.
        Returns:
        Returns a random zip.