Package com.github.tadukoo.web.rest.json
Class JSONArrayBodyHandler<Item>
java.lang.Object
com.github.tadukoo.web.rest.json.JSONArrayBodyHandler<Item>
- All Implemented Interfaces:
HttpResponse.BodyHandler<com.github.tadukoo.parsing.json.JSONArray<Item>>
public class JSONArrayBodyHandler<Item>
extends Object
implements HttpResponse.BodyHandler<com.github.tadukoo.parsing.json.JSONArray<Item>>
A Response Body Handler used for grabbing the response as a
JSONArray
.- Since:
- Alpha v.0.1
- Version:
- Alpha v.0.1.2
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionJSONArrayBodyHandler
(Class<Item> clazz) Constructs a JSON Array Body Handler for the given type of item -
Method Summary
Modifier and TypeMethodDescriptionHttpResponse.BodySubscriber<com.github.tadukoo.parsing.json.JSONArray<Item>>
apply
(HttpResponse.ResponseInfo responseInfo) static <Item> HttpResponse.BodySubscriber<com.github.tadukoo.parsing.json.JSONArray<Item>>
-
Field Details
-
clazz
The class to convert the response items into
-
-
Constructor Details
-
JSONArrayBodyHandler
Constructs a JSON Array Body Handler for the given type of item- Parameters:
clazz
- The class to convert the response items into
-
-
Method Details
-
apply
public HttpResponse.BodySubscriber<com.github.tadukoo.parsing.json.JSONArray<Item>> apply(HttpResponse.ResponseInfo responseInfo) - Specified by:
apply
in interfaceHttpResponse.BodyHandler<Item>
-
asJSON
public static <Item> HttpResponse.BodySubscriber<com.github.tadukoo.parsing.json.JSONArray<Item>> asJSON(Class<Item> clazz) - Type Parameters:
Item
- The type of class to convert the response items into- Parameters:
clazz
- The class to convert the response items into- Returns:
- A Response Body Subscriber that will convert a response into a
JSONArray
-