Skip to content

Commit

Permalink
Provides financial terms. (#1319)
Browse files Browse the repository at this point in the history
  • Loading branch information
bodiam authored Aug 5, 2024
1 parent 91879cd commit a88cc1f
Show file tree
Hide file tree
Showing 6 changed files with 615 additions and 0 deletions.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/main/java/net/datafaker/providers/base/BaseProviders.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ default Finance finance() {
return getProvider(Finance.class, Finance::new);
}

default FinancialTerms financialTerms() {
return getProvider(FinancialTerms.class, FinancialTerms::new);
}

default FunnyName funnyName() {
return getProvider(FunnyName.class, FunnyName::new);
}
Expand Down
69 changes: 69 additions & 0 deletions src/main/java/net/datafaker/providers/base/FinancialTerms.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package net.datafaker.providers.base;

/**
* Provides financial terms.
*
* @since 2.4.0
*/
public class FinancialTerms extends AbstractProvider<BaseProviders> {

public FinancialTerms(BaseProviders faker) {
super(faker);
}

public String noun() {
return noun(faker.options().option(FinancialTerms.Category.class));
}

public String noun(Category category) {
return resolve("financial_terms." + category.getName() + ".nouns");
}

public String verb() {
return verb(faker.options().option(FinancialTerms.Category.class));
}

public String verb(Category category) {
return resolve("financial_terms." + category.getName() + ".verbs");
}

public String adjective() {
return adjective(faker.options().option(FinancialTerms.Category.class));
}

public String adjective(Category category) {
return resolve("financial_terms." + category.getName() + ".adjectives");
}

public enum Category {
ACCOUNT_MANAGEMENT("account_management"),
TRANSACTIONS("transactions"),
PAYMENTS("payments"),
TRANSFERS("transfers"),
INVESTMENTS("investments"),
LOANS("loans"),
ALERTS_AND_NOTIFICATIONS("alerts_and_notifications"),
CUSTOMER_SUPPORT("customer_support"),
SECURITY("security"),
REGULATORY_COMPLIANCE("regulatory_compliance"),
MARKET_DATA("market_data"),
USER_ACTIVITY("user_activity"),
BANKING("banking"),
CARDS("cards"),
CRYPTOCURRENCY("cryptocurrency"),
INSURANCE("insurance"),
REWARDS_AND_LOYALTY("rewards_and_loyalty"),
MISCELLANEOUS("miscellaneous");

private final String name;

Category(String name) {
this.name = name;
}

public String getName() {
return name;
}
}

}
1 change: 1 addition & 0 deletions src/main/java/net/datafaker/service/files/EnFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public String getPath() {
"final_fantasy_xiv.yml",
"final_space.yml",
"finance.yml",
"financial_terms.yml",
"food.yml",
"football.yml",
"formula1.yml",
Expand Down
Loading

0 comments on commit a88cc1f

Please sign in to comment.