java.lang.Object
dev.mccue.jdk.httpserver.json.JsonBody
- All Implemented Interfaces:
dev.mccue.jdk.httpserver.Body
An implementation of
Body which will respond with Json.-
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()static JsonBodyof(dev.mccue.json.JsonEncodable jsonEncodable) Creates aJsonBody.static dev.mccue.json.Jsonread(HttpExchange exchange) static <T> Tread(HttpExchange exchange, dev.mccue.json.JsonDecoder<T> decoder) dev.mccue.jdk.httpserver.ResponseLengthtoString()voidwriteTo(OutputStream outputStream)
-
Method Details
-
of
Creates aJsonBody.- Parameters:
jsonEncodable- The JSON to use.- Returns:
- A
JsonBody
-
read
- Throws:
IOException
-
read
public static <T> T read(HttpExchange exchange, dev.mccue.json.JsonDecoder<T> decoder) throws IOException - Throws:
IOException
-
writeTo
- Specified by:
writeToin interfacedev.mccue.jdk.httpserver.Body- Throws:
IOException
-
responseLength
public dev.mccue.jdk.httpserver.ResponseLength responseLength()- Specified by:
responseLengthin interfacedev.mccue.jdk.httpserver.Body
-
defaultContentType
- Specified by:
defaultContentTypein interfacedev.mccue.jdk.httpserver.Body
-
equals
-
hashCode
public int hashCode() -
toString
-