| 1 | package com.github.javafaker; |
| 2 | |
| 3 | public class Address { |
| 4 | private final Faker faker; |
| 5 | |
| 6 | protected Address(Faker faker) { |
| 7 | this.faker = faker; |
| 8 | } |
| 9 | |
| 10 | public String streetName() { |
| 11 | return faker.fakeValuesService().resolve("address.street_name", this, faker); |
| 12 | } |
| 13 | |
| 14 | public String streetAddressNumber() { |
| 15 | return String.valueOf(faker.random().nextInt(1000)); |
| 16 | } |
| 17 | |
| 18 | public String streetAddress() { |
| 19 | return faker.fakeValuesService().resolve("address.street_address", this, faker); |
| 20 | } |
| 21 | |
| 22 | public String streetAddress(boolean includeSecondary) { |
| 23 | String streetAddress = faker.fakeValuesService().resolve("address.street_address", this, faker); |
| 24 | if (includeSecondary) { |
| 25 | streetAddress = streetAddress + " " + secondaryAddress(); |
| 26 | } |
| 27 | return streetAddress; |
| 28 | } |
| 29 | |
| 30 | public String secondaryAddress() { |
| 31 | return faker.numerify(faker.fakeValuesService().resolve("address.secondary_address", this,faker)); |
| 32 | } |
| 33 | |
| 34 | public String zipCode() { |
| 35 | return faker.bothify(faker.fakeValuesService().resolve("address.postcode", this,faker)); |
| 36 | } |
| 37 | |
| 38 | public String zipCodeByState(String stateAbbr) { |
| 39 | return faker.fakeValuesService().resolve("address.postcode_by_state." + stateAbbr, this, faker); |
| 40 | } |
| 41 | |
| 42 | public String countyByZipCode(String postCode) { |
| 43 | return faker.fakeValuesService().resolve("address.county_by_postcode." + postCode, this, faker); |
| 44 | } |
| 45 | |
| 46 | public String streetSuffix() { |
| 47 | return faker.fakeValuesService().resolve("address.street_suffix", this, faker); |
| 48 | } |
| 49 | |
| 50 | public String streetPrefix() { |
| 51 | return faker.fakeValuesService().resolve("address.street_prefix", this, faker); |
| 52 | } |
| 53 | |
| 54 | public String citySuffix() { |
| 55 | return faker.fakeValuesService().resolve("address.city_suffix", this, faker); |
| 56 | } |
| 57 | |
| 58 | public String cityPrefix() { |
| 59 | return faker.fakeValuesService().resolve("address.city_prefix", this, faker); |
| 60 | } |
nothing calls this directly
no outgoing calls
no test coverage detected