Class EthosResponseBuilder

  • Direct Known Subclasses:
    EthosResponseConverter

    public class EthosResponseBuilder
    extends Object
    Intended to be used to more easily build an EthosResponse object from the given org.apache.http.HttpResponse.
    • Constructor Detail

      • EthosResponseBuilder

        public EthosResponseBuilder()
        No-arg constructor for instantiating this class. Builds the headerList.
    • Method Detail

      • buildEthosResponse

        public EthosResponse buildEthosResponse​(org.apache.http.HttpResponse httpResponse)
                                         throws IOException
        Builds an EthosResponse object from the given org.apache.http.HttpResponse. The headerList is built taking header values from the given org.apache.http.HttpResponse for the headers listed in EthosResponse. Also copies the response body content and Http status code.
        Parameters:
        httpResponse - The org.apache.http.HttpResponse to build an EthosResponse from.
        Returns:
        An EthosResponse containing the headers values from the given org.apache.http.HttpResponse for the headers defined in EthosResponse, the response body content, and the response Http status code, or null if the given org.apache.http.HttpResponse is null.
        Throws:
        IOException - Thrown if the response body (entity) cannot be converted to a String value.