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 Type
    Method
    Description
    boolean
    fetch(Quote quote)
    Fetches updated quote data from this source.
    default Quote
    Fetches a quote for the given symbol.
    default String
    Returns the name of this quote source.
    default boolean
    Returns true if this source provides real-time data.
  • Method Details

    • fetch

      boolean fetch(Quote quote) throws UnavailableDataException
      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 retrieved
      IllegalArgumentException - if quote is null
    • fetchBySymbol

      default Quote fetchBySymbol(String symbol) throws UnavailableDataException
      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

      default String getSourceName()
      Returns the name of this quote source.
      Returns:
      the source name
    • isRealTime

      default boolean isRealTime()
      Returns true if this source provides real-time data.
      Returns:
      true if real-time, false if delayed