package com.nifty.cloud.ncs.http;

/**
 * Responsible for parsing an HTTP response and returning an object of type T.
 * For example, a typical response parser might accept a response, and
 * translate it into a concrete typed object.
 *
 * HTTP応答の解析用インタフェースです。
 *
 * @param <T>
 *            The output of this response parser.
 */
public interface HttpResponseParser<T>
{
    /**
     * Accepts an HTTP response object, and returns an object of type T.
     * Individual implementations may choose to parse the response however they
     * need to, and return any type that they need to.
     *
     * {@link HttpResponse}に保持された応答情報を解析します。
     *
     * @param response
     *            The HTTP response to parse, as received from an NIFCLOUD service.
     *            HTTP応答内容
     *
     * @return An object of type T, as defined by individual implementations.
     * 	個々の実装によって定義されたT型のオブジェクト
     *
     * @throws Exception
     */
	public T parse(HttpResponse response) throws Exception;

}
