Class HandlerSpecification
java.lang.Object
com.pixelservices.flash.components.http.HandlerSpecification
Represents the specification for a request handler, including details about the endpoint,
HTTP method, and expected request structure.
-
Constructor Summary
ConstructorsConstructorDescriptionHandlerSpecification
(RequestHandler requestHandler, String endpoint, HttpMethod method, boolean enforcedNonNullBody) Constructs a HandlerSpecification for a given request handler, endpoint, HTTP method, and body enforcement policy. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the endpoint for this handler.Retrieves the expected body fields for this handler.Retrieves the expected body files for this handler.Retrieves the expected request parameters for this handler.Retrieves the HTTP method for this handler.boolean
Indicates whether a non-null body is enforced for requests.toString()
Returns a string representation of the HandlerSpecification, including endpoint, HTTP method, expected request details, and body enforcement status.
-
Constructor Details
-
HandlerSpecification
public HandlerSpecification(RequestHandler requestHandler, String endpoint, HttpMethod method, boolean enforcedNonNullBody) Constructs a HandlerSpecification for a given request handler, endpoint, HTTP method, and body enforcement policy.- Parameters:
requestHandler
- the associated RequestHandlerendpoint
- the endpoint for this handlermethod
- the HTTP method (e.g., GET, POST)enforcedNonNullBody
- whether a non-null body is enforced
-
-
Method Details
-
getEndpoint
Retrieves the endpoint for this handler.- Returns:
- the endpoint
-
getMethod
Retrieves the HTTP method for this handler.- Returns:
- the HTTP method
-
isEnforcedNonNullBody
public boolean isEnforcedNonNullBody()Indicates whether a non-null body is enforced for requests.- Returns:
true
if a non-null body is enforced, otherwisefalse
-
getExpectedRequestParameters
Retrieves the expected request parameters for this handler.- Returns:
- a map of parameter names to their specifications
-
getExpectedBodyFields
Retrieves the expected body fields for this handler.- Returns:
- a map of field names to their specifications
-
getExpectedBodyFiles
Retrieves the expected body files for this handler.- Returns:
- a map of file names to their specifications
-
toString
Returns a string representation of the HandlerSpecification, including endpoint, HTTP method, expected request details, and body enforcement status.
-