public interface ServerResponseStatus extends ServerResponseElement
| Modifier and Type | Method and Description |
|---|---|
int |
getStatusCode()
Returns the status code of the response
|
java.util.Optional<java.lang.String> |
getStatusText()
Returns the option status text
|
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.
|
int getStatusCode()
java.util.Optional<java.lang.String> getStatusText()
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