public interface ServerResponseBodyPart extends ServerResponseElement
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBodyPartBytes()
Returns the bytes of the response body.
|
default <T> T |
match(java.util.function.Function<ServerResponseStatus,T> matchStatus,
java.util.function.Function<ServerResponseHeaders,T> matchHeaders,
java.util.function.Function<ServerResponseBodyPart,T> matchBodyPart,
java.util.function.Function<ServerResponse,T> matchServerResponse)
Apply a function on this instance, depending on its type.
|
byte[] getBodyPartBytes()
default <T> T match(java.util.function.Function<ServerResponseStatus,T> matchStatus, java.util.function.Function<ServerResponseHeaders,T> matchHeaders, java.util.function.Function<ServerResponseBodyPart,T> matchBodyPart, java.util.function.Function<ServerResponse,T> matchServerResponse)
This uses a condensed form of the Visitor pattern.
match in interface ServerResponseElementT - the return type of all matcher functionsmatchStatus - the function to invoke when this instance is a ServerResponseStatusmatchHeaders - the function to invoke when this instance is a ServerResponseHeadersmatchBodyPart - the function to invoke when this instance is a ServerResponseBodyPartmatchServerResponse - the function to invoke when this instance is a ServerResponse