Interface QuoteSource
public interface QuoteSource
Interface for retrieving market quotes from data sources.
Implementations connect to various financial data providers to fetch real-time or delayed stock, bond, and commodity quotes.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
Modifier and TypeMethodDescriptionbooleanFetches updated quote data from this source.default QuotefetchBySymbol(String symbol) Fetches a quote for the given symbol.default StringReturns the name of this quote source.default booleanReturns true if this source provides real-time data.
-
Method Details
-
fetch
Fetches updated quote data from this source.The quote object is updated in place with current pricing data.
- Parameters:
quote- the quote to update with current data- Returns:
- true if the fetch was successful
- Throws:
UnavailableDataException- if data cannot be retrievedIllegalArgumentException- if quote is null
-
fetchBySymbol
Fetches a quote for the given symbol.- Parameters:
symbol- the ticker symbol- Returns:
- the quote with current data
- Throws:
UnavailableDataException- if data cannot be retrieved
-
getSourceName
-
isRealTime
default boolean isRealTime()Returns true if this source provides real-time data.- Returns:
- true if real-time, false if delayed
-