-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added street, street no. and apartement no. in EN and PL versions to be generated in the addresssss. Localised address string. Added interface and implementation to provide localised address strings.
- Loading branch information
1 parent
1d687c8
commit 6fa5c2d
Showing
24 changed files
with
240 additions
and
202 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,6 @@ | |
* @author Jakub Kubrynski | ||
*/ | ||
interface FairyFactory { | ||
|
||
Fairy createFairy(Locale locale, String filePrefix); | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/java/eu/codearte/jfairy/producer/company/CompanyProvider.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
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
14 changes: 14 additions & 0 deletions
14
src/main/java/eu/codearte/jfairy/producer/person/AddressStringProvider.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,14 @@ | ||
package eu.codearte.jfairy.producer.person; | ||
|
||
import javax.inject.Singleton; | ||
|
||
/** | ||
* @author omaciaszek | ||
* @since 15.02.15 | ||
*/ | ||
@Singleton | ||
public interface AddressStringProvider { | ||
|
||
String addressString(Address address); | ||
|
||
} |
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
27 changes: 27 additions & 0 deletions
27
src/main/java/eu/codearte/jfairy/producer/person/locale/en/EnAddressStringProvider.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,27 @@ | ||
package eu.codearte.jfairy.producer.person.locale.en; | ||
|
||
import eu.codearte.jfairy.producer.person.Address; | ||
import eu.codearte.jfairy.producer.person.AddressStringProvider; | ||
|
||
/** | ||
* @author omaciaszek | ||
* @since 15.02.15 | ||
*/ | ||
public class EnAddressStringProvider implements AddressStringProvider { | ||
|
||
@Override | ||
public String addressString(Address address) { | ||
return address.streetNumber() + " " + address.street() + " Str." + apartmentString(address) | ||
+ ", " + address.getPostalCode() + " " + address.getCity(); | ||
} | ||
|
||
private String apartmentString(Address address) { | ||
String apartmentString; | ||
if (address.apartmentNumber().equals("")) { | ||
apartmentString = ""; | ||
} else { | ||
apartmentString = " No. " + address.apartmentNumber(); | ||
} | ||
return apartmentString; | ||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
src/main/java/eu/codearte/jfairy/producer/person/locale/pl/PlAddressStringProvider.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,29 @@ | ||
package eu.codearte.jfairy.producer.person.locale.pl; | ||
|
||
import eu.codearte.jfairy.producer.person.Address; | ||
import eu.codearte.jfairy.producer.person.AddressStringProvider; | ||
|
||
/** | ||
* @author omaciaszek | ||
* @since 15.02.15 | ||
*/ | ||
public class PlAddressStringProvider implements AddressStringProvider { | ||
|
||
@Override | ||
public String addressString(Address address) { | ||
return | ||
"ul. " + address.street() + " " + address.streetNumber() + apartmentString( | ||
address) + ", " + address.getPostalCode() | ||
+ " " + address.getCity(); | ||
} | ||
|
||
private String apartmentString(Address address) { | ||
String apartmentString; | ||
if (address.apartmentNumber().equals("")) { | ||
apartmentString = ""; | ||
} else { | ||
apartmentString = " lok. " + address.apartmentNumber(); | ||
} | ||
return apartmentString; | ||
} | ||
} |
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
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
4 changes: 2 additions & 2 deletions
4
src/test/groovy/eu/codearte/jfairy/producer/CompanySpec.groovy
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
2 changes: 1 addition & 1 deletion
2
src/test/groovy/eu/codearte/jfairy/producer/net/NetworkSpec.groovy
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
Oops, something went wrong.