Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ dependencies {
implementation("org.apache.commons:commons-lang3:${apacheCommonsVersion}")
implementation("com.diffplug.spotless:spotless-plugin-gradle:${spotlessVersion}")

testImplementation("org.assertj:assertj-core:${assertJVersion}")
testImplementation("org.mockito:mockito-core:${mockitoCoreVersion}")
testImplementation("org.mockito:mockito-junit-jupiter:${mockitoJunitVersion}")
testImplementation(platform("org.junit:junit-bom:${junitVersion}"))
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
projectVersion=0.3.0
assertJVersion=3.27.4
junitVersion=5.10.0
mockitoJunitVersion=2.17.0
mockitoCoreVersion=5.18.0
Expand Down
17 changes: 9 additions & 8 deletions src/main/java/dev/sorn/fmp4j/clients/FmpBulkClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
import dev.sorn.fmp4j.types.FmpPart;
import dev.sorn.fmp4j.types.FmpPeriod;
import dev.sorn.fmp4j.types.FmpYear;
import java.util.List;

public class FmpBulkClient {

// Alphabetical order
protected final FmpService<FmpCompanies[]> fmpBulkCompaniesService;
protected final FmpService<FmpBalanceSheetStatement[]> fmpBulkBalanceSheetService;
protected final FmpService<FmpCashFlowStatement[]> fmpBulkCashFlowService;
protected final FmpService<FmpCashFlowStatementGrowth[]> fmpBulkCashFlowStatementGrowthService;
protected final FmpService<FmpCompanies> fmpBulkCompaniesService;
protected final FmpService<FmpBalanceSheetStatement> fmpBulkBalanceSheetService;
protected final FmpService<FmpCashFlowStatement> fmpBulkCashFlowService;
protected final FmpService<FmpCashFlowStatementGrowth> fmpBulkCashFlowStatementGrowthService;

public FmpBulkClient(FmpConfig fmpConfig, FmpHttpClient fmpHttpClient) {
this.fmpBulkCompaniesService = new FmpBulkCompaniesService(fmpConfig, fmpHttpClient);
Expand All @@ -34,24 +35,24 @@
new FmpBulkCashFlowStatementGrowthService(fmpConfig, fmpHttpClient);
}

public synchronized FmpCompanies[] companies(FmpPart part) {
public synchronized List<FmpCompanies> companies(FmpPart part) {

Check warning on line 38 in src/main/java/dev/sorn/fmp4j/clients/FmpBulkClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpBulkClient.java#L38

Use block level rather than method level synchronization
fmpBulkCompaniesService.param("part", part);
return fmpBulkCompaniesService.download();
}

public synchronized FmpBalanceSheetStatement[] balanceSheetStatements(FmpYear year, FmpPeriod period) {
public synchronized List<FmpBalanceSheetStatement> balanceSheetStatements(FmpYear year, FmpPeriod period) {

Check warning on line 43 in src/main/java/dev/sorn/fmp4j/clients/FmpBulkClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpBulkClient.java#L43

Use block level rather than method level synchronization
fmpBulkBalanceSheetService.param(PARAM_YEAR, year);
fmpBulkBalanceSheetService.param(PARAM_PERIOD, period);
return fmpBulkBalanceSheetService.download();
}

public synchronized FmpCashFlowStatement[] cashFlowStatements(FmpYear year, FmpPeriod period) {
public synchronized List<FmpCashFlowStatement> cashFlowStatements(FmpYear year, FmpPeriod period) {

Check warning on line 49 in src/main/java/dev/sorn/fmp4j/clients/FmpBulkClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpBulkClient.java#L49

Use block level rather than method level synchronization
fmpBulkCashFlowService.param(PARAM_YEAR, year);
fmpBulkCashFlowService.param(PARAM_PERIOD, period);
return fmpBulkCashFlowService.download();
}

public synchronized FmpCashFlowStatementGrowth[] cashFlowStatementGrowth(FmpYear year, FmpPeriod period) {
public synchronized List<FmpCashFlowStatementGrowth> cashFlowStatementGrowth(FmpYear year, FmpPeriod period) {

Check warning on line 55 in src/main/java/dev/sorn/fmp4j/clients/FmpBulkClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpBulkClient.java#L55

Use block level rather than method level synchronization
fmpBulkCashFlowStatementGrowthService.param(PARAM_YEAR, year);
fmpBulkCashFlowStatementGrowthService.param(PARAM_PERIOD, period);
return fmpBulkCashFlowStatementGrowthService.download();
Expand Down
37 changes: 19 additions & 18 deletions src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,21 @@
import dev.sorn.fmp4j.services.FmpSplitsCalendarService;
import dev.sorn.fmp4j.types.FmpSymbol;
import java.time.LocalDate;
import java.util.List;
import java.util.Optional;

public class FmpCalendarClient {

// Alphabetical order
protected final FmpService<FmpDividend[]> fmpDividendService;
protected final FmpService<FmpDividendsCalendar[]> fmpDividendsCalendarService;
protected final FmpService<FmpEarning[]> fmpEarningsService;
protected final FmpService<FmpEarningsCalendar[]> fmpEarningsCalendarService;
protected final FmpService<FmpIposCalendar[]> fmpIposCalendarService;
protected final FmpService<FmpIposDisclosure[]> fmpIposDisclosureService;
protected final FmpService<FmpIposProspectus[]> fmpIposProspectusService;
protected final FmpService<FmpSplit[]> fmpSplitService;
protected final FmpService<FmpSplitsCalendar[]> fmpSplitsCalendarService;
protected final FmpService<FmpDividend> fmpDividendService;
protected final FmpService<FmpDividendsCalendar> fmpDividendsCalendarService;
protected final FmpService<FmpEarning> fmpEarningsService;
protected final FmpService<FmpEarningsCalendar> fmpEarningsCalendarService;
protected final FmpService<FmpIposCalendar> fmpIposCalendarService;
protected final FmpService<FmpIposDisclosure> fmpIposDisclosureService;
protected final FmpService<FmpIposProspectus> fmpIposProspectusService;
protected final FmpService<FmpSplit> fmpSplitService;
protected final FmpService<FmpSplitsCalendar> fmpSplitsCalendarService;

public FmpCalendarClient(FmpConfig fmpConfig, FmpHttpClient fmpHttpClient) {
this.fmpDividendService = new FmpDividendService(fmpConfig, fmpHttpClient);
Expand All @@ -54,47 +55,47 @@
this.fmpSplitsCalendarService = new FmpSplitsCalendarService(fmpConfig, fmpHttpClient);
}

public synchronized FmpDividendsCalendar[] dividends() {
public synchronized List<FmpDividendsCalendar> dividends() {

Check warning on line 58 in src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java#L58

Use block level rather than method level synchronization
return fmpDividendsCalendarService.download();
}

public synchronized FmpDividend[] dividends(FmpSymbol symbol) {
public synchronized List<FmpDividend> dividends(FmpSymbol symbol) {

Check warning on line 62 in src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java#L62

Use block level rather than method level synchronization
fmpDividendService.param(PARAM_SYMBOL, symbol);
return fmpDividendService.download();
}

public synchronized FmpEarningsCalendar[] earnings() {
public synchronized List<FmpEarningsCalendar> earnings() {

Check warning on line 67 in src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java#L67

Use block level rather than method level synchronization
return fmpEarningsCalendarService.download();
}

public synchronized FmpEarning[] earnings(FmpSymbol symbol) {
public synchronized List<FmpEarning> earnings(FmpSymbol symbol) {

Check warning on line 71 in src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java#L71

Use block level rather than method level synchronization
fmpEarningsService.param(PARAM_SYMBOL, symbol);
return fmpEarningsService.download();
}

public synchronized FmpIposCalendar[] ipos(Optional<LocalDate> from, Optional<LocalDate> to) {
public synchronized List<FmpIposCalendar> ipos(Optional<LocalDate> from, Optional<LocalDate> to) {

Check warning on line 76 in src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java#L76

Use block level rather than method level synchronization
fmpIposCalendarService.param(PARAM_FROM, from);
fmpIposCalendarService.param(PARAM_TO, to);
return fmpIposCalendarService.download();
}

public synchronized FmpIposDisclosure[] disclosures(Optional<LocalDate> from, Optional<LocalDate> to) {
public synchronized List<FmpIposDisclosure> disclosures(Optional<LocalDate> from, Optional<LocalDate> to) {

Check warning on line 82 in src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java#L82

Use block level rather than method level synchronization
fmpIposDisclosureService.param(PARAM_FROM, from);
fmpIposDisclosureService.param(PARAM_TO, to);
return fmpIposDisclosureService.download();
}

public synchronized FmpIposProspectus[] prospectus(Optional<LocalDate> from, Optional<LocalDate> to) {
public synchronized List<FmpIposProspectus> prospectus(Optional<LocalDate> from, Optional<LocalDate> to) {

Check warning on line 88 in src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java#L88

Use block level rather than method level synchronization
fmpIposProspectusService.param(PARAM_FROM, from);
fmpIposProspectusService.param(PARAM_TO, to);
return fmpIposProspectusService.download();
}

public synchronized FmpSplitsCalendar[] splits() {
public synchronized List<FmpSplitsCalendar> splits() {

Check warning on line 94 in src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java#L94

Use block level rather than method level synchronization
return fmpSplitsCalendarService.download();
}

public synchronized FmpSplit[] splits(FmpSymbol symbol) {
public synchronized List<FmpSplit> splits(FmpSymbol symbol) {

Check warning on line 98 in src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpCalendarClient.java#L98

Use block level rather than method level synchronization
fmpSplitService.param(PARAM_SYMBOL, symbol);
return fmpSplitService.download();
}
Expand Down
23 changes: 12 additions & 11 deletions src/main/java/dev/sorn/fmp4j/clients/FmpChartClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,19 @@
import dev.sorn.fmp4j.types.FmpInterval;
import dev.sorn.fmp4j.types.FmpSymbol;
import java.time.LocalDate;
import java.util.List;
import java.util.Optional;

public class FmpChartClient {

protected final FmpService<FmpHistoricalPriceEodLight[]> fmpHistoricalPriceEodLightService;
protected final FmpService<FmpHistoricalPriceEodFull[]> fmpHistoricalPriceEodFullService;
protected final FmpService<FmpHistoricalChart[]> fmpHistoricalChartService1MinService;
protected final FmpService<FmpHistoricalChart[]> fmpHistoricalChartService5MinService;
protected final FmpService<FmpHistoricalChart[]> fmpHistoricalChartService15MinService;
protected final FmpService<FmpHistoricalChart[]> fmpHistoricalChartService30MinService;
protected final FmpService<FmpHistoricalChart[]> fmpHistoricalChartService1HourService;
protected final FmpService<FmpHistoricalChart[]> fmpHistoricalChartService4HourService;
protected final FmpService<FmpHistoricalPriceEodLight> fmpHistoricalPriceEodLightService;
protected final FmpService<FmpHistoricalPriceEodFull> fmpHistoricalPriceEodFullService;
protected final FmpService<FmpHistoricalChart> fmpHistoricalChartService1MinService;
protected final FmpService<FmpHistoricalChart> fmpHistoricalChartService5MinService;
protected final FmpService<FmpHistoricalChart> fmpHistoricalChartService15MinService;
protected final FmpService<FmpHistoricalChart> fmpHistoricalChartService30MinService;
protected final FmpService<FmpHistoricalChart> fmpHistoricalChartService1HourService;
protected final FmpService<FmpHistoricalChart> fmpHistoricalChartService4HourService;

public FmpChartClient(FmpConfig fmpConfig, FmpHttpClient fmpHttpClient) {
this.fmpHistoricalPriceEodLightService = new FmpHistoricalPriceEodLightService(fmpConfig, fmpHttpClient);
Expand All @@ -49,23 +50,23 @@
this.fmpHistoricalChartService4HourService = new FmpHistoricalChartService(fmpConfig, fmpHttpClient, FOUR_HOUR);
}

public synchronized FmpHistoricalPriceEodLight[] historicalPriceEodLight(
public synchronized List<FmpHistoricalPriceEodLight> historicalPriceEodLight(

Check warning on line 53 in src/main/java/dev/sorn/fmp4j/clients/FmpChartClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpChartClient.java#L53

Use block level rather than method level synchronization
FmpSymbol symbol, Optional<LocalDate> from, Optional<LocalDate> to) {
fmpHistoricalPriceEodLightService.param(PARAM_SYMBOL, symbol);
from.ifPresent(date -> fmpHistoricalPriceEodLightService.param(PARAM_FROM, date));
to.ifPresent(date -> fmpHistoricalPriceEodLightService.param(PARAM_TO, date));
return fmpHistoricalPriceEodLightService.download();
}

public synchronized FmpHistoricalPriceEodFull[] historicalPriceEodFull(
public synchronized List<FmpHistoricalPriceEodFull> historicalPriceEodFull(

Check warning on line 61 in src/main/java/dev/sorn/fmp4j/clients/FmpChartClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpChartClient.java#L61

Use block level rather than method level synchronization
FmpSymbol symbol, Optional<LocalDate> from, Optional<LocalDate> to) {
fmpHistoricalPriceEodFullService.param(PARAM_SYMBOL, symbol);
from.ifPresent(date -> fmpHistoricalPriceEodFullService.param(PARAM_FROM, date));
to.ifPresent(date -> fmpHistoricalPriceEodFullService.param(PARAM_TO, date));
return fmpHistoricalPriceEodFullService.download();
}

public synchronized FmpHistoricalChart[] historical(
public synchronized List<FmpHistoricalChart> historical(

Check warning on line 69 in src/main/java/dev/sorn/fmp4j/clients/FmpChartClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpChartClient.java#L69

Use block level rather than method level synchronization
FmpSymbol symbol, FmpInterval interval, Optional<LocalDate> from, Optional<LocalDate> to) {
return switch (interval) {
case ONE_MINUTE -> {
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/dev/sorn/fmp4j/clients/FmpCompanyClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@
import dev.sorn.fmp4j.services.FmpCompanyService;
import dev.sorn.fmp4j.services.FmpService;
import dev.sorn.fmp4j.types.FmpSymbol;
import java.util.List;

public class FmpCompanyClient {

// Alphabetical order
protected final FmpService<FmpCompany[]> fmpCompanyService;
protected final FmpService<FmpCompany> fmpCompanyService;

public FmpCompanyClient(FmpConfig fmpConfig, FmpHttpClient fmpHttpClient) {
this.fmpCompanyService = new FmpCompanyService(fmpConfig, fmpHttpClient);
}

public synchronized FmpCompany[] bySymbol(FmpSymbol symbol) {
public synchronized List<FmpCompany> bySymbol(FmpSymbol symbol) {

Check warning on line 22 in src/main/java/dev/sorn/fmp4j/clients/FmpCompanyClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpCompanyClient.java#L22

Use block level rather than method level synchronization
fmpCompanyService.param(PARAM_SYMBOL, symbol);
return fmpCompanyService.download();
}
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/dev/sorn/fmp4j/clients/FmpDirectoryClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,24 @@
import dev.sorn.fmp4j.services.FmpEtfListService;
import dev.sorn.fmp4j.services.FmpService;
import dev.sorn.fmp4j.services.FmpStockListService;
import java.util.List;

public class FmpDirectoryClient {

// Alphabetical order
protected final FmpService<FmpEtf[]> fmpEtfListService;
protected final FmpService<FmpStock[]> fmpStockListService;
protected final FmpService<FmpEtf> fmpEtfListService;
protected final FmpService<FmpStock> fmpStockListService;

public FmpDirectoryClient(FmpConfig fmpConfig, FmpHttpClient fmpHttpClient) {
this.fmpEtfListService = new FmpEtfListService(fmpConfig, fmpHttpClient);
this.fmpStockListService = new FmpStockListService(fmpConfig, fmpHttpClient);
}

public synchronized FmpEtf[] etfs() {
public synchronized List<FmpEtf> etfs() {

Check warning on line 23 in src/main/java/dev/sorn/fmp4j/clients/FmpDirectoryClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpDirectoryClient.java#L23

Use block level rather than method level synchronization
return fmpEtfListService.download();
}

public synchronized FmpStock[] stocks() {
public synchronized List<FmpStock> stocks() {

Check warning on line 27 in src/main/java/dev/sorn/fmp4j/clients/FmpDirectoryClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpDirectoryClient.java#L27

Use block level rather than method level synchronization
return fmpStockListService.download();
}
}
17 changes: 9 additions & 8 deletions src/main/java/dev/sorn/fmp4j/clients/FmpEarningsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@
import dev.sorn.fmp4j.types.FmpQuarter;
import dev.sorn.fmp4j.types.FmpSymbol;
import dev.sorn.fmp4j.types.FmpYear;
import java.util.List;
import java.util.Optional;

public class FmpEarningsClient {

// Alphabetical order
protected final FmpService<FmpEarningsCallTranscript[]> fmpEarningsCallTranscriptService;
protected final FmpService<FmpEarningsCallTranscriptDate[]> fmpEarningsCallTranscriptDatesService;
protected final FmpService<FmpEarningsCallTranscriptLatest[]> fmpEarningsCallTranscriptLatestService;
protected final FmpService<FmpEarningsCallTranscriptList[]> fmpEarningsCallTranscriptListService;
protected final FmpService<FmpEarningsCallTranscript> fmpEarningsCallTranscriptService;
protected final FmpService<FmpEarningsCallTranscriptDate> fmpEarningsCallTranscriptDatesService;
protected final FmpService<FmpEarningsCallTranscriptLatest> fmpEarningsCallTranscriptLatestService;
protected final FmpService<FmpEarningsCallTranscriptList> fmpEarningsCallTranscriptListService;

public FmpEarningsClient(FmpConfig fmpConfig, FmpHttpClient fmpHttpClient) {
this.fmpEarningsCallTranscriptService = new FmpEarningsCallTranscriptService(fmpConfig, fmpHttpClient);
Expand All @@ -43,7 +44,7 @@
this.fmpEarningsCallTranscriptListService = new FmpEarningsCallTranscriptListService(fmpConfig, fmpHttpClient);
}

public synchronized FmpEarningsCallTranscript[] transcripts(
public synchronized List<FmpEarningsCallTranscript> transcripts(

Check warning on line 47 in src/main/java/dev/sorn/fmp4j/clients/FmpEarningsClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpEarningsClient.java#L47

Use block level rather than method level synchronization
FmpSymbol symbol, FmpYear year, FmpQuarter quarter, Optional<FmpLimit> limit) {
fmpEarningsCallTranscriptService.param(PARAM_SYMBOL, symbol);
fmpEarningsCallTranscriptService.param(PARAM_YEAR, year);
Expand All @@ -52,18 +53,18 @@
return fmpEarningsCallTranscriptService.download();
}

public synchronized FmpEarningsCallTranscriptDate[] dates(FmpSymbol symbol) {
public synchronized List<FmpEarningsCallTranscriptDate> dates(FmpSymbol symbol) {

Check warning on line 56 in src/main/java/dev/sorn/fmp4j/clients/FmpEarningsClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpEarningsClient.java#L56

Use block level rather than method level synchronization
fmpEarningsCallTranscriptDatesService.param(PARAM_SYMBOL, symbol);
return fmpEarningsCallTranscriptDatesService.download();
}

public synchronized FmpEarningsCallTranscriptLatest[] latest(Optional<FmpLimit> limit, Optional<FmpPage> page) {
public synchronized List<FmpEarningsCallTranscriptLatest> latest(Optional<FmpLimit> limit, Optional<FmpPage> page) {

Check warning on line 61 in src/main/java/dev/sorn/fmp4j/clients/FmpEarningsClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpEarningsClient.java#L61

Use block level rather than method level synchronization
fmpEarningsCallTranscriptLatestService.param(PARAM_LIMIT, limit.orElse(limit(100)));
fmpEarningsCallTranscriptLatestService.param(PARAM_PAGE, page.orElse(page(0)));
return fmpEarningsCallTranscriptLatestService.download();
}

public synchronized FmpEarningsCallTranscriptList[] list() {
public synchronized List<FmpEarningsCallTranscriptList> list() {

Check warning on line 67 in src/main/java/dev/sorn/fmp4j/clients/FmpEarningsClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpEarningsClient.java#L67

Use block level rather than method level synchronization
return fmpEarningsCallTranscriptListService.download();
}
}
5 changes: 3 additions & 2 deletions src/main/java/dev/sorn/fmp4j/clients/FmpEconomicsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@
import dev.sorn.fmp4j.services.FmpService;
import dev.sorn.fmp4j.services.FmpTreasuryRatesService;
import java.time.LocalDate;
import java.util.List;

public class FmpEconomicsClient {
protected final FmpService<FmpTreasuryRate[]> fmpTreasuryRatesService;
protected final FmpService<FmpTreasuryRate> fmpTreasuryRatesService;

public FmpEconomicsClient(FmpConfig fmpConfig, FmpHttpClient fmpHttpClient) {
this.fmpTreasuryRatesService = new FmpTreasuryRatesService(fmpConfig, fmpHttpClient);
}

public synchronized FmpTreasuryRate[] treasuryRates(LocalDate from, LocalDate to) {
public synchronized List<FmpTreasuryRate> treasuryRates(LocalDate from, LocalDate to) {

Check warning on line 21 in src/main/java/dev/sorn/fmp4j/clients/FmpEconomicsClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpEconomicsClient.java#L21

Use block level rather than method level synchronization
fmpTreasuryRatesService.param(PARAM_FROM, from);
fmpTreasuryRatesService.param(PARAM_TO, to);
return fmpTreasuryRatesService.download();
Expand Down
21 changes: 11 additions & 10 deletions src/main/java/dev/sorn/fmp4j/clients/FmpEtfClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
import dev.sorn.fmp4j.services.FmpEtfSectorWeightingService;
import dev.sorn.fmp4j.services.FmpService;
import dev.sorn.fmp4j.types.FmpSymbol;
import java.util.List;

public class FmpEtfClient {
// Alphabetical order
protected final FmpService<FmpEtfAssetExposure[]> etfAssetExposureService;
protected final FmpService<FmpEtfCountryWeighting[]> etfCountryWeightingService;
protected final FmpService<FmpEtfHolding[]> etfHoldingService;
protected final FmpService<FmpEtfInfo[]> etfInfoService;
protected final FmpService<FmpEtfSectorWeighting[]> etfSectorWeightingService;
protected final FmpService<FmpEtfAssetExposure> etfAssetExposureService;
protected final FmpService<FmpEtfCountryWeighting> etfCountryWeightingService;
protected final FmpService<FmpEtfHolding> etfHoldingService;
protected final FmpService<FmpEtfInfo> etfInfoService;
protected final FmpService<FmpEtfSectorWeighting> etfSectorWeightingService;

public FmpEtfClient(FmpConfig fmpConfig, FmpHttpClient fmpHttpClient) {
this.etfAssetExposureService = new FmpEtfAssetExposureService(fmpConfig, fmpHttpClient);
Expand All @@ -33,27 +34,27 @@
this.etfSectorWeightingService = new FmpEtfSectorWeightingService(fmpConfig, fmpHttpClient);
}

public synchronized FmpEtfAssetExposure[] assetExposure(FmpSymbol symbol) {
public synchronized List<FmpEtfAssetExposure> assetExposure(FmpSymbol symbol) {

Check warning on line 37 in src/main/java/dev/sorn/fmp4j/clients/FmpEtfClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpEtfClient.java#L37

Use block level rather than method level synchronization
etfAssetExposureService.param(PARAM_SYMBOL, symbol);
return etfAssetExposureService.download();
}

public synchronized FmpEtfCountryWeighting[] countryWeightings(FmpSymbol symbol) {
public synchronized List<FmpEtfCountryWeighting> countryWeightings(FmpSymbol symbol) {

Check warning on line 42 in src/main/java/dev/sorn/fmp4j/clients/FmpEtfClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpEtfClient.java#L42

Use block level rather than method level synchronization
etfCountryWeightingService.param(PARAM_SYMBOL, symbol);
return etfCountryWeightingService.download();
}

public synchronized FmpEtfHolding[] holdings(FmpSymbol symbol) {
public synchronized List<FmpEtfHolding> holdings(FmpSymbol symbol) {

Check warning on line 47 in src/main/java/dev/sorn/fmp4j/clients/FmpEtfClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpEtfClient.java#L47

Use block level rather than method level synchronization
etfHoldingService.param(PARAM_SYMBOL, symbol);
return etfHoldingService.download();
}

public synchronized FmpEtfInfo[] info(FmpSymbol symbol) {
public synchronized List<FmpEtfInfo> info(FmpSymbol symbol) {

Check warning on line 52 in src/main/java/dev/sorn/fmp4j/clients/FmpEtfClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpEtfClient.java#L52

Use block level rather than method level synchronization
etfInfoService.param(PARAM_SYMBOL, symbol);
return etfInfoService.download();
}

public synchronized FmpEtfSectorWeighting[] sectorWeightings(FmpSymbol symbol) {
public synchronized List<FmpEtfSectorWeighting> sectorWeightings(FmpSymbol symbol) {

Check warning on line 57 in src/main/java/dev/sorn/fmp4j/clients/FmpEtfClient.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/dev/sorn/fmp4j/clients/FmpEtfClient.java#L57

Use block level rather than method level synchronization
etfSectorWeightingService.param(PARAM_SYMBOL, symbol);
return etfSectorWeightingService.download();
}
Expand Down
Loading
Loading