Class DynamicRoute
- java.lang.Object
-
- org.logdoc.fairhttp.service.api.helpers.DynamicRoute
-
public class DynamicRoute extends Object
- Author:
- Denis Danilin | me@loslobos.ru 01.03.2023 14:27 FairHttpService ☭ sweat and blood
-
-
Field Summary
Fields Modifier and Type Field Description BiFunction<Http.Request,Map<String,String>,CompletionStage<Http.Response>>asyncCallbackBiFunction<Http.Request,Map<String,String>,Http.Response>callbackStringendpointStringmethod
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DynamicRouteasync(String method, String endpoint, BiFunction<Http.Request,Map<String,String>,CompletionStage<Http.Response>> callback)One async endpointstatic DynamicRoutesync(String method, String endpoint, BiFunction<Http.Request,Map<String,String>,Http.Response> callback)One synced endpoint
-
-
-
Field Detail
-
method
public final String method
-
endpoint
public final String endpoint
-
callback
public final BiFunction<Http.Request,Map<String,String>,Http.Response> callback
-
asyncCallback
public final BiFunction<Http.Request,Map<String,String>,CompletionStage<Http.Response>> asyncCallback
-
-
Method Detail
-
sync
public static DynamicRoute sync(String method, String endpoint, BiFunction<Http.Request,Map<String,String>,Http.Response> callback)
One synced endpoint- Parameters:
method- HTTP method (GET, POST, PUT, etc)endpoint- Fully qualified endpoint. If its patterned - it must be Java RegEx synthax compliant and groups must be correctly mappable to callback argumentscallback- invocation of request with mapped path variables by names given in pathVarsNames- Returns:
- Fully constructed Route to endpoint
-
async
public static DynamicRoute async(String method, String endpoint, BiFunction<Http.Request,Map<String,String>,CompletionStage<Http.Response>> callback)
One async endpoint- Parameters:
method- HTTP method (GET, POST, PUT, etc)endpoint- Fully qualified endpoint. If its patterned - it must be Java RegEx synthax compliant and groups must be correctly mappable to callback argumentscallback- invocation of request with mapped path variables by names given in pathVarsNames- Returns:
- Fully constructed Route to endpoint
-
-