Class HandlerSpecification

java.lang.Object
com.pixelservices.flash.components.http.HandlerSpecification

public class HandlerSpecification extends Object
Represents the specification for a request handler, including details about the endpoint, HTTP method, and expected request structure.
  • 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 RequestHandler
      endpoint - the endpoint for this handler
      method - the HTTP method (e.g., GET, POST)
      enforcedNonNullBody - whether a non-null body is enforced
  • Method Details

    • getEndpoint

      public String getEndpoint()
      Retrieves the endpoint for this handler.
      Returns:
      the endpoint
    • getMethod

      public HttpMethod 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, otherwise false
    • getExpectedRequestParameters

      public Map<String,ExpectedRequestParameter> getExpectedRequestParameters()
      Retrieves the expected request parameters for this handler.
      Returns:
      a map of parameter names to their specifications
    • getExpectedBodyFields

      public Map<String,ExpectedBodyField> getExpectedBodyFields()
      Retrieves the expected body fields for this handler.
      Returns:
      a map of field names to their specifications
    • getExpectedBodyFiles

      public Map<String,ExpectedBodyFile> getExpectedBodyFiles()
      Retrieves the expected body files for this handler.
      Returns:
      a map of file names to their specifications
    • toString

      public String toString()
      Returns a string representation of the HandlerSpecification, including endpoint, HTTP method, expected request details, and body enforcement status.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the specification