Module quak.framework.web
Record Class SimplePathController<T,U>
java.lang.Object
java.lang.Record
io.john.amiscaray.quak.web.controller.SimplePathController<T,U>
- Type Parameters:
T- The type of the request body.U- The type of the response body.- Record Components:
requestBodyType- The type of the request body.responseBodyType- The type of the response body.requestHandler- A function handling the request and returning a response.
- All Implemented Interfaces:
PathController<T,U>
public record SimplePathController<T,U> (Class<T> requestBodyType, Class<U> responseBodyType, RequestHandler<T,U> requestHandler)
extends Record
implements PathController<T,U>
A simple implementation of
PathController.-
Constructor Summary
ConstructorsConstructorDescriptionSimplePathController(Class<T> requestBodyType, Class<U> responseBodyType, RequestHandler<T, U> requestHandler) Creates an instance of aSimplePathControllerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of therequestBodyTyperecord component.Returns the value of therequestHandlerrecord component.Returns the value of theresponseBodyTyperecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SimplePathController
public SimplePathController(Class<T> requestBodyType, Class<U> responseBodyType, RequestHandler<T, U> requestHandler) Creates an instance of aSimplePathControllerrecord class.- Parameters:
requestBodyType- the value for therequestBodyTyperecord componentresponseBodyType- the value for theresponseBodyTyperecord componentrequestHandler- the value for therequestHandlerrecord 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). -
requestBodyType
Returns the value of therequestBodyTyperecord component.- Specified by:
requestBodyTypein interfacePathController<T,U> - Returns:
- the value of the
requestBodyTyperecord component
-
responseBodyType
Returns the value of theresponseBodyTyperecord component.- Specified by:
responseBodyTypein interfacePathController<T,U> - Returns:
- the value of the
responseBodyTyperecord component
-
requestHandler
Returns the value of therequestHandlerrecord component.- Specified by:
requestHandlerin interfacePathController<T,U> - Returns:
- the value of the
requestHandlerrecord component
-