-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
375 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
src/main/java/net/andreinc/mockneat/unit/address/Addresses.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package net.andreinc.mockneat.unit.address; | ||
|
||
import net.andreinc.mockneat.MockNeat; | ||
import net.andreinc.mockneat.abstraction.MockUnitBase; | ||
import net.andreinc.mockneat.abstraction.MockUnitString; | ||
|
||
import java.util.function.Supplier; | ||
|
||
import static net.andreinc.mockneat.types.enums.StringFormatType.CAPITALIZED; | ||
|
||
public class Addresses extends MockUnitBase implements MockUnitString { | ||
|
||
private static String[] SUFFIXES = new String[]{ | ||
"Ave", | ||
"Avenue", | ||
"St", | ||
"Street", | ||
"Blvd", | ||
"Rd", | ||
"Road", | ||
"Hill" | ||
}; | ||
|
||
private static String[] PREFIXES = new String[]{ | ||
"Line", | ||
"Suite", | ||
"Apartment", | ||
"Ap" | ||
}; | ||
|
||
public static Addresses addresses() { | ||
return MockNeat.threadLocal().addresses(); | ||
} | ||
|
||
public Addresses(MockNeat mockNeat) { | ||
super(mockNeat); | ||
} | ||
|
||
/** | ||
* <p>Returns a {@code MockUnitString} that can be used to generate the address lines</p> | ||
* | ||
* @return A new {@code MockUnitString}. | ||
*/ | ||
@Override | ||
public Supplier<String> supplier() { | ||
return mockNeat.fmt("#{line1} #{line2}") | ||
.param("line1", line1()) | ||
.param("line2", line2()) | ||
.supplier(); | ||
} | ||
|
||
/** | ||
* <p>Returns a {@code MockUnitString} that can be used to generate the first address line with the format:</p> | ||
* <p>number noun suffix (Ave, Avenue, Street, etc.)</p> | ||
* | ||
* @return A new {@code MockUnitString}. | ||
*/ | ||
public MockUnitString line1() { | ||
return mockNeat.fmt("#{num} #{noun} #{end}") | ||
.param("num", mockNeat.ints().range(10, 20000)) | ||
.param("noun", mockNeat.words().nouns().format(CAPITALIZED)) | ||
.param("end", mockNeat.from(SUFFIXES)); | ||
} | ||
|
||
/** | ||
* <p>Returns a {@code MockUnitString} that can be used to generate the second address line with the format:</p> | ||
* <p>prefix (Line, Suite, Apartment) number</p> | ||
* | ||
* @return A new {@code MockUnitString}. | ||
*/ | ||
public MockUnitString line2() { | ||
return mockNeat.fmt("#{prefix} #{number}") | ||
.param("prefix", mockNeat.from(PREFIXES)) | ||
.param("number", mockNeat.ints().range(1, 1000)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,5 @@ George H. W. Bush | |
William J. Clinton | ||
George W. Bush | ||
Barack Obama | ||
Donald J. Trump | ||
Donald J. Trump | ||
Joe R. Biden |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
Abuja | ||
Accra | ||
Addis Ababa | ||
Algiers | ||
Antananarivo | ||
Asmara | ||
Bamako | ||
Bangui | ||
Banjul | ||
Bissau | ||
Brazzaville | ||
Bujumbura | ||
Cairo | ||
Cape Town | ||
Bloemfontein | ||
Pretoria | ||
Conakry | ||
Dakar | ||
Dodoma | ||
Dar es Salaam | ||
Djibouti | ||
El Aaiún | ||
Freetown | ||
Gaborone | ||
Harare | ||
Juba | ||
Kampala | ||
Khartoum | ||
Kigali | ||
Kinshasa | ||
Libreville | ||
Lilongwe | ||
Mbabane | ||
Lobamba | ||
Lomé | ||
Luanda | ||
Lusaka | ||
Malabo | ||
Maputo | ||
Maseru | ||
Mogadishu | ||
Monrovia | ||
Moroni | ||
Nairobi | ||
N'Djamena | ||
Niamey | ||
Nouakchott | ||
Ouagadougou | ||
Port Louis | ||
Porto-Novo | ||
Cotonou | ||
Praia | ||
Rabat | ||
Tripoli | ||
Tunis | ||
Victoria | ||
Windhoek | ||
Yamoussoukro | ||
Yaoundé |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Asunción | ||
Basseterre | ||
Belmopan | ||
Bogotá | ||
Brasilia | ||
Bridgetown | ||
Buenos Aires | ||
Caracas | ||
Castries | ||
Georgetown | ||
Guatemala City | ||
Havana | ||
Kingston | ||
Kingstown | ||
La Paz | ||
Sucre | ||
Lima | ||
Managua | ||
México | ||
Montevideo | ||
Nassau | ||
Ottawa | ||
Panamá | ||
Paramaribo | ||
Port au Prince | ||
Port of Spain | ||
Quito | ||
Roseau | ||
Saint George's | ||
Saint John's | ||
San José | ||
San Salvador | ||
Santiago | ||
Santo Domingo | ||
Tegucigalpa | ||
Washington |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Abu Dhabi | ||
Amman | ||
Ankara | ||
Ashgabat | ||
Nur-Sultan | ||
Baghdad | ||
Baku | ||
Bandar | ||
Bangkok | ||
Beijing | ||
Beirut | ||
Bishkek | ||
Colombo | ||
Kotte | ||
Damascus | ||
Dhaka | ||
Dili | ||
Doha | ||
Dushanbe | ||
Hanoi | ||
Islamabad | ||
Jakarta | ||
Jerusalem | ||
Kabul | ||
Kathmandu | ||
Kuala Lumpur | ||
Kuwait-City | ||
Lhasa | ||
Malé | ||
Manama | ||
Manila | ||
Muscat | ||
Naypyidaw | ||
New Delhi | ||
Phnom Penh | ||
P'yongyang | ||
Riyadh | ||
Sanaa | ||
Seoul | ||
Singapore | ||
Taipei | ||
Tashkent | ||
T'bilisi | ||
Tehran | ||
Thimphu | ||
Tokyo | ||
Ulaanbaatar | ||
Vientiane | ||
Yerevan |
20 changes: 20 additions & 0 deletions
20
src/main/resources/dicts/cities/cities-capitals-australia-and-oceania
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Adamstown | ||
Alofi | ||
Apia | ||
Avarua | ||
Canberra | ||
Hagåtña | ||
Funafuti | ||
Honiara | ||
Majuro | ||
Ngerulmud | ||
Nouméa | ||
Nuku'alofa | ||
Pago Pago | ||
Palikir | ||
Papeete | ||
Port Moresby | ||
Port Vila | ||
Saipan | ||
Suva | ||
Wellington |
Oops, something went wrong.