public class HeaderFunctions extends Object
MultiMap) manipulations
function chains can be created programmatically or via JSON config.
Apply the function chain on a MultiMap with headers=chain.apply(headers);| Modifier and Type | Class and Description |
|---|---|
static class |
HeaderFunctions.EvalScope |
| Modifier and Type | Field and Description |
|---|---|
static HeaderFunction |
DO_NOTHING |
| Constructor and Description |
|---|
HeaderFunctions() |
| Modifier and Type | Method and Description |
|---|---|
static HeaderFunction |
parseFromJson(io.vertx.core.json.JsonArray config)
Example configuration (a JSON array):
|
static HeaderFunction |
parseStaticHeadersFromJson(io.vertx.core.json.JsonObject staticHeaders)
Deprecated.
|
static Consumer<HeaderFunctions.EvalScope> |
remove(String headerName) |
static Consumer<HeaderFunctions.EvalScope> |
setAlways(String headerName,
String expression) |
static Consumer<HeaderFunctions.EvalScope> |
setIfAbsent(String headerName,
String expression) |
static Consumer<HeaderFunctions.EvalScope> |
setIfPresent(String headerName,
String expression) |
public static final HeaderFunction DO_NOTHING
public static HeaderFunction parseFromJson(io.vertx.core.json.JsonArray config) throws IllegalArgumentException
[
{ "header": "xxx" , "value": "111" },
{ "header": "yyy" , "value": "222" },
{ "header": "yyy" , "value": "333" , "mode": "complete" },
{ "header": "zzz" , "value": "444" , "mode": "override" },
{ "header": "oli" , "value": "{xxx}-{yyy}" },
{ "header": "xxx" , "value": null },
{ "header": "preSuff", "value": "pre-{yyy}-suff" }
]
Notes:
"value" : null to remove a headerconfig - the JSON configuration for the header manipulator chainIllegalArgumentException@Deprecated public static HeaderFunction parseStaticHeadersFromJson(io.vertx.core.json.JsonObject staticHeaders)
public static Consumer<HeaderFunctions.EvalScope> remove(String headerName)
public static Consumer<HeaderFunctions.EvalScope> setAlways(String headerName, String expression)
public static Consumer<HeaderFunctions.EvalScope> setIfAbsent(String headerName, String expression)
public static Consumer<HeaderFunctions.EvalScope> setIfPresent(String headerName, String expression)
Copyright © 2016–2020. All rights reserved.