From d7305e5342e6c997997b7e41df746e39165bbd41 Mon Sep 17 00:00:00 2001 From: f4 Date: Sun, 26 Nov 2023 04:33:04 +0100 Subject: [PATCH] Update version and encapsulate class fields in IEXCloudClient The pom.xml version was updated from 1.13.0-SNAPSHOT to 2.0.0-SNAPSHOT. This signifies substantial changes or upgrades in the application. In the IEXCloudClient.java, class field variables (reference, companyData, historicalData) were changed from public to private to adhere to good Object-Oriented Programming practices. Public accessors (fetchReferenceData, fetchCompanyData, fetchHistoricalData) were also added for each field to safely retrieve their values. --- pom.xml | 2 +- .../java/io/github/f4pl0/IEXCloudClient.java | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index a2d6cb5..3a2e86f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.github.f4pl0 iex-cloud - 1.13.0-SNAPSHOT + 2.0.0-SNAPSHOT jar IEX Cloud Java wrapper for IEX Cloud API diff --git a/src/main/java/io/github/f4pl0/IEXCloudClient.java b/src/main/java/io/github/f4pl0/IEXCloudClient.java index 42f0158..1f369e9 100644 --- a/src/main/java/io/github/f4pl0/IEXCloudClient.java +++ b/src/main/java/io/github/f4pl0/IEXCloudClient.java @@ -13,9 +13,9 @@ */ public class IEXCloudClient { public final EquitiesMarketData equitiesMarketData; - public final Reference reference; - public final CompanyData companyData; - public final HistoricalData historicalData; + private final Reference reference; + private final CompanyData companyData; + private final HistoricalData historicalData; /** * Create a new IEXCloudClient. @@ -29,6 +29,18 @@ private IEXCloudClient(IEXCloudConfig config) { historicalData = new HistoricalData(); } + public Reference fetchReferenceData() { + return this.reference; + } + + public CompanyData fetchCompanyData() { + return this.companyData; + } + + public HistoricalData fetchHistoricalData() { + return this.historicalData; + } + /** * Builder for the IEXCloudClient. * You will need to set the publishable token before building the client.