Module quak.framework.web.model
Record Class SimpleRequest<T>
java.lang.Object
java.lang.Record
io.john.amiscaray.quak.http.request.SimpleRequest<T>
- Type Parameters:
T- The type of the request body.- Record Components:
headers- The headers as a map.queryParams- The query parameters as a map.method- The request method.body- The request body.attributes- The attributes for the request (for server-side use).
- All Implemented Interfaces:
Request<T>
public record SimpleRequest<T>(Map<String,String> headers, Map<String,String> queryParams, RequestMethod method, T body, Map<String,Object> attributes)
extends Record
implements Request<T>
A simple HTTP request.
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleRequest(RequestMethod method, T body) Create a SimpleRequest with empty headers, query params, and attributes.SimpleRequest(Map<String, String> queryParams) Create a SimpleRequest with empty headers, a request method of GET, an empty body, and empty attributes.SimpleRequest(Map<String, String> headers, RequestMethod method, T body) Create a SimpleRequest with empty queryParams and no attributes.SimpleRequest(Map<String, String> headers, Map<String, String> queryParams, RequestMethod method, T body, Map<String, Object> attributes) Creates an instance of aSimpleRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributesrecord component.body()Returns the value of thebodyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.headers()Returns the value of theheadersrecord component.method()Returns the value of themethodrecord component.Returns the value of thequeryParamsrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.john.amiscaray.quak.http.request.Request
getJWTAuthToken, getUserAuthentication
-
Constructor Details
-
SimpleRequest
Create a SimpleRequest with empty queryParams and no attributes.- Parameters:
headers- The headers as a map.method- The request method.body- The request body.
-
SimpleRequest
Create a SimpleRequest with empty headers, query params, and attributes.- Parameters:
method- The request method.body- The request body.
-
SimpleRequest
Create a SimpleRequest with empty headers, a request method of GET, an empty body, and empty attributes.- Parameters:
queryParams- The query params.
-
SimpleRequest
public SimpleRequest(Map<String, String> headers, Map<String, String> queryParams, RequestMethod method, T body, Map<String, Object> attributes) Creates an instance of aSimpleRequestrecord class.- Parameters:
headers- the value for theheadersrecord componentqueryParams- the value for thequeryParamsrecord componentmethod- the value for themethodrecord componentbody- the value for thebodyrecord componentattributes- the value for theattributesrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
headers
Returns the value of theheadersrecord component. -
queryParams
Returns the value of thequeryParamsrecord component.- Specified by:
queryParamsin interfaceRequest<T>- Returns:
- the value of the
queryParamsrecord component
-
method
Returns the value of themethodrecord component. -
body
Returns the value of thebodyrecord component. -
attributes
Returns the value of theattributesrecord component.- Specified by:
attributesin interfaceRequest<T>- Returns:
- the value of the
attributesrecord component
-