Package com.github.tadukoo.web.rest.json
Class JSONClassBodyHandler<J extends com.github.tadukoo.parsing.json.JSONClass>
java.lang.Object
com.github.tadukoo.web.rest.json.JSONClassBodyHandler<J>
- Type Parameters:
J- TheJSONClassto convert the response into
- All Implemented Interfaces:
HttpResponse.BodyHandler<J>
public class JSONClassBodyHandler<J extends com.github.tadukoo.parsing.json.JSONClass>
extends Object
implements HttpResponse.BodyHandler<J>
A Response Body Handler used for grabbing the response as a specific
JSONClass.- Version:
- Alpha v.0.1
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJSONClassBodyHandler(Class<J> clazz) Constructs a JSON Class Body Handler for the givenJSONClass -
Method Summary
Modifier and TypeMethodDescriptionapply(HttpResponse.ResponseInfo responseInfo) static <J> HttpResponse.BodySubscriber<J>
-
Field Details
-
clazz
TheJSONClassclass to convert the response into
-
-
Constructor Details
-
JSONClassBodyHandler
Constructs a JSON Class Body Handler for the givenJSONClass- Parameters:
clazz- TheJSONClassclass to convert the response into
-
-
Method Details
-
apply
- Specified by:
applyin interfaceHttpResponse.BodyHandler<J extends com.github.tadukoo.parsing.json.JSONClass>
-
asJSON
- Type Parameters:
J- The specificJSONClassto convert the response into- Parameters:
clazz- TheJSONClassto convert the response into- Returns:
- A Response Body Subscriber that will convert a response into a specific
JSONClass
-