Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make delimiter for latLon and lonLat configurable #258

Merged
merged 1 commit into from
Jul 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/main/java/net/datafaker/Address.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,28 @@ public String longitude() {
* @return Returns the lat/lon coordinates formatted as lat,lon.
*/
public String latLon() {
return latitude() + "," + longitude();
return latLon(",");
}

/**
* @return Returns the lat/lon coordinates formatted as lat delimiter lon.
*/
public String latLon(String delimiter) {
return latitude() + delimiter + longitude();
}

/**
* @return Returns the lat/lon coordinates formatted as lon,lat.
*/
public String lonLat() {
return longitude() + "," + latitude();
return lonLat(",");
}

/**
* @return Returns the lat/lon coordinates formatted as lon delimiter lat.
*/
public String lonLat(String delimiter) {
return longitude() + delimiter + latitude();
}

public String timeZone() {
Expand Down