com.github.javafaker.Country Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javafaker Show documentation
Show all versions of javafaker Show documentation
This library is a port of Ruby's stympy/faker gem (as well as Perl's Data::Faker library) that generates fake data.
It's useful when you're developing a new project and need some pretty data for showcase.
package com.github.javafaker;
public class Country {
private final Faker faker;
private final String flagUrl;
protected Country(Faker faker) {
this.faker = faker;
this.flagUrl = "http://flags.fmcdn.net/data/flags/w580/";
}
public String flag() {
return flagUrl + faker.fakeValuesService().resolve("country.code2", this, faker) + ".png";
}
public String countryCode2() {
return faker.fakeValuesService().resolve("country.code2", this, faker);
}
public String countryCode3() {
return faker.fakeValuesService().resolve("country.code3", this, faker);
}
public String capital() {
return faker.fakeValuesService().resolve("country.capital", this, faker);
}
public String currency() {
return faker.fakeValuesService().resolve("country.currency", this, faker);
}
public String currencyCode() {
return faker.fakeValuesService().resolve("country.currency_code", this, faker);
}
}