Record Class HttpRequestImpl

java.lang.Object
java.lang.Record
net.uiqui.embedhttp.api.impl.HttpRequestImpl
All Implemented Interfaces:
HttpRequest

public record HttpRequestImpl(Request request, Route route, Map<String,String> pathParameters) extends Record implements HttpRequest
  • Constructor Details

    • HttpRequestImpl

      public HttpRequestImpl(Request request, Route route, Map<String,String> pathParameters)
      Creates an instance of a HttpRequestImpl record class.
      Parameters:
      request - the value for the request record component
      route - the value for the route record component
      pathParameters - the value for the pathParameters record component
  • Method Details

    • getMethod

      public HttpMethod getMethod()
      Description copied from interface: HttpRequest
      Gets the HTTP method of the request.
      Specified by:
      getMethod in interface HttpRequest
      Returns:
      the HTTP method
    • getURL

      public String getURL()
      Description copied from interface: HttpRequest
      Gets the full URL of the request.
      Specified by:
      getURL in interface HttpRequest
      Returns:
      the URL as a string
    • getPath

      public String getPath()
      Description copied from interface: HttpRequest
      Gets the path of the request (excluding query parameters).
      Specified by:
      getPath in interface HttpRequest
      Returns:
      the path as a string
    • getQueryParameters

      public Map<String,String> getQueryParameters()
      Description copied from interface: HttpRequest
      Gets the query parameters from the URL.
      Specified by:
      getQueryParameters in interface HttpRequest
      Returns:
      a map of query parameter names to their values
    • getHeaders

      public Map<String,String> getHeaders()
      Description copied from interface: HttpRequest
      Gets the headers of the request.
      Specified by:
      getHeaders in interface HttpRequest
      Returns:
      a map of header names to their values
    • getBody

      public String getBody()
      Description copied from interface: HttpRequest
      Gets the body of the request.
      Specified by:
      getBody in interface HttpRequest
      Returns:
      the body as a string
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • request

      public Request request()
      Returns the value of the request record component.
      Returns:
      the value of the request record component
    • route

      public Route route()
      Returns the value of the route record component.
      Returns:
      the value of the route record component
    • pathParameters

      public Map<String,String> pathParameters()
      Returns the value of the pathParameters record component.
      Specified by:
      pathParameters in interface HttpRequest
      Returns:
      the value of the pathParameters record component