Class AerisCustomResponse<T>

  • Type Parameters:
    T - The wrapper object for response list

    public abstract class AerisCustomResponse<T>
    extends AerisBasics
    Custom response class to extend for easier parsing of the JSON string returned from a custom response.
    • Constructor Detail

      • AerisCustomResponse

        public AerisCustomResponse​(Class<T> clazz)
        Constructor needed to pass the Class type for parsing the list parse of the response from JSON Strings to the desired class as a list.
        Parameters:
        clazz - Class type the list of responses is wrapped too.
    • Method Detail

      • getNumberOfResponses

        public int getNumberOfResponses()
        Returns the number of responses for this AerisResponse.
        Returns:
        Number of responses
      • fromJSON

        public void fromJSON​(String json)
        Description copied from class: AerisBasics
        Construction from a JSON object. This constructor is needed to properly pull the JSON as the JSON response field can be an array or just a single object, so this helps fix that.
        Overrides:
        fromJSON in class AerisBasics
        Parameters:
        json - Json object to use to construct the AerisResponse
      • getResponse

        public T getResponse​(int index)
        Gets the data for the given index. Pass into a AerisFriendlyResponse
        Parameters:
        index - index to get the response at.
        Returns:
        AerisData at that index.
      • getFirstResponse

        public T getFirstResponse()
        Gets the first index in the list of the AerisDataJSON responses.
        Returns:
        data for the first response.
      • getListOfResponse

        public List<T> getListOfResponse()
        Gets the list of data responses
        Returns:
        The list of data responses.