Class QuotesRequest<T>

  • Type Parameters:
    T - Type of object that can contain the retrieved information from a quotes request
    Direct Known Subclasses:
    FxQuotesQuery1V7Request, StockQuotesQuery1V7Request

    public abstract class QuotesRequest<T>
    extends java.lang.Object
    Author:
    Stijn Strickx
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String symbols  
    • Constructor Summary

      Constructors 
      Constructor Description
      QuotesRequest​(java.lang.String symbols)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<T> getResult()
      Sends the request to Yahoo Finance and parses the result
      T getSingleResult()  
      java.lang.String getSymbols()  
      protected abstract T parseJson​(com.fasterxml.jackson.databind.JsonNode node)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • symbols

        protected final java.lang.String symbols
    • Constructor Detail

      • QuotesRequest

        public QuotesRequest​(java.lang.String symbols)
    • Method Detail

      • getSymbols

        public java.lang.String getSymbols()
      • parseJson

        protected abstract T parseJson​(com.fasterxml.jackson.databind.JsonNode node)
      • getSingleResult

        public T getSingleResult()
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • getResult

        public java.util.List<T> getResult()
                                    throws java.io.IOException
        Sends the request to Yahoo Finance and parses the result
        Returns:
        List of parsed objects resulting from the Yahoo Finance request
        Throws:
        java.io.IOException - when there's a connection problem or the request is incorrect