Add StarCraft content class, add utility methods to Faker.

This commit is contained in:
mpaauw
2020-04-12 09:50:39 -07:00
parent 13434940d3
commit f32790fda7
2 changed files with 33 additions and 0 deletions
@@ -97,6 +97,7 @@ public class Faker {
private final AquaTeenHungerForce aquaTeenHungerForce;
private final ProgrammingLanguage programmingLanguage;
private final Kaamelott kaamelott;
private final StarCraft starCraft;
public Faker() {
this(Locale.ENGLISH);
@@ -203,6 +204,7 @@ public class Faker {
this.aquaTeenHungerForce = new AquaTeenHungerForce(this);
this.programmingLanguage = new ProgrammingLanguage(this);
this.kaamelott = new Kaamelott(this);
this.starCraft = new StarCraft(this);
}
/**
@@ -641,6 +643,10 @@ public class Faker {
return kaamelott;
}
public StarCraft starCraft() {
return starCraft;
}
public String resolve(String key) {
return this.fakeValuesService.resolve(key, this, this);
}
@@ -0,0 +1,27 @@
package com.github.javafaker;
public class StarCraft {
private final Faker faker;
protected StarCraft(final Faker faker) {
this.faker = faker;
}
public String unit() {
return faker.fakeValuesService().resolve("starcraft.units", this, faker);
}
public String building() {
return faker.fakeValuesService().resolve("starcraft.buildings", this, faker);
}
public String character() {
return faker.fakeValuesService().resolve("starcraft.characters", this, faker);
}
public String planet() {
return faker.fakeValuesService().resolve("starcraft.planets", this, faker);
}
}