Skip to content

Commit 7b78b84

Browse files
authored
Add Starships to the Star Trek provider (#1642)
1 parent 489234f commit 7b78b84

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

src/main/java/net/datafaker/providers/entertainment/StarTrek.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,33 @@ protected StarTrek(EntertainmentProviders faker) {
1111
super(faker);
1212
}
1313

14+
/** @return a random Star Trek character */
1415
public String character() {
1516
return resolve("star_trek.character");
1617
}
1718

19+
/** @return a random Star Trek location (planet, starbase, area of space) */
1820
public String location() {
1921
return resolve("star_trek.location");
2022
}
2123

24+
/** @return a random alien species */
2225
public String species() {
2326
return resolve("star_trek.species");
2427
}
2528

29+
/** @return a random Star Trek villain */
2630
public String villain() {
2731
return resolve("star_trek.villain");
2832
}
2933

34+
/** @return a random Klingon phrase */
3035
public String klingon() {
3136
return resolve("star_trek.klingon");
3237
}
38+
39+
/** @return a random Federation starship */
40+
public String starship() {
41+
return resolve("star_trek.starship");
42+
}
3343
}

src/main/resources/en/star_trek.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,29 @@ en:
117117
- "lumbe' tlhInganpu'."
118118
- "Dubotchugh yIpummoH"
119119
- "mataHmeH maSachnIS"
120+
starship:
121+
- "USS Enterprise"
122+
- "USS Voyager"
123+
- "USS Defiant"
124+
- "USS Excelsior"
125+
- "USS Discovery"
126+
- "USS Reliant"
127+
- "USS Grissom"
128+
- "USS Kelvin"
129+
- "USS Franklin"
130+
- "USS Stargazer"
131+
- "USS Cerritos"
132+
- "USS Prometheus"
133+
- "USS Protostar"
134+
- "USS Titan"
135+
- "USS Equinox"
136+
- "USS Saratoga"
137+
- "USS Hood"
138+
- "USS Valiant"
139+
- "USS Lexington"
140+
- "USS Farragut"
141+
- "USS Rutledge"
142+
- "USS Pegasus"
143+
- "USS Phoenix"
144+
- "USS Crazy Horse"
145+
- "USS Thy'lek Shran"

src/test/java/net/datafaker/providers/entertainment/StarTrekTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ protected Collection<TestSpec> providerListTest() {
1515
TestSpec.of(starTrek::location, "star_trek.location"),
1616
TestSpec.of(starTrek::klingon, "star_trek.klingon"),
1717
TestSpec.of(starTrek::species, "star_trek.species"),
18-
TestSpec.of(starTrek::villain, "star_trek.villain")
18+
TestSpec.of(starTrek::villain, "star_trek.villain"),
19+
TestSpec.of(starTrek::starship, "star_trek.starship")
1920
);
2021
}
2122
}

0 commit comments

Comments
 (0)