refactored, pre-buffer reuse

This commit is contained in:
Relism
2026-03-15 14:31:52 +01:00
parent f1beb160aa
commit b0d606cb5f
64 changed files with 888 additions and 400 deletions
@@ -0,0 +1,17 @@
package dev.relism.models;
/**
* Base class for class-based route handlers.
*
* <p>Annotate the subclass with {@link dev.relism.routing.Route @Route} and register it
* via {@link dev.relism.routing.AbstractRouter#register}. For one-off routes, prefer the
* lambda DSL ({@code server.get(path, handler)}) which wraps a {@link SimpleHandler} internally.
*/
public abstract class RequestHandler {
/**
* Handles an incoming request. The return value determines the response body:
* return a {@link Response} to replace the whole response, any other non-null value
* to set it as the body, or {@code null} to leave the response as-is.
*/
public abstract Object handle(Request request, Response response);
}