Class RequestResult
java.lang.Object
com.soklet.core.RequestResult
Encapsulates the results of a request (both logical response and bytes to be sent over the wire),
useful for integration testing via
Simulator.performRequest(Request)
.- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder used to construct instances ofRequestResult
viawithMarshaledResponse(MarshaledResponse)
.static class
Builder used to copy instances ofRequestResult
viacopy()
. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Vends a mutable copier seeded with this instance's data, suitable for building new instances.boolean
The CORS preflight logical response, if applicable for the request.The final representation of the response to be written over the wire.The Resource Method that handled the request, if available.The logical response, determined by the return value of the Resource Method (if available).int
hashCode()
toString()
static RequestResult.Builder
withMarshaledResponse
(MarshaledResponse marshaledResponse) Acquires a builder forRequestResult
instances.
-
Method Details
-
withMarshaledResponse
@Nonnull public static RequestResult.Builder withMarshaledResponse(@Nonnull MarshaledResponse marshaledResponse) Acquires a builder forRequestResult
instances.- Parameters:
marshaledResponse
- the bytes that will ultimately be written over the wire- Returns:
- the builder
-
copy
Vends a mutable copier seeded with this instance's data, suitable for building new instances.- Returns:
- a copier for this instance
-
toString
-
equals
-
hashCode
-
getMarshaledResponse
The final representation of the response to be written over the wire.- Returns:
- the response to be written over the wire
-
getResponse
The logical response, determined by the return value of the Resource Method (if available).- Returns:
- the logical response
-
getCorsPreflightResponse
The CORS preflight logical response, if applicable for the request.- Returns:
- the CORS preflight logical response
-
getResourceMethod
The Resource Method that handled the request, if available.- Returns:
- the Resource Method that handled the request
-