public final class JsonBodyFilters extends Object
| Modifier and Type | Method and Description |
|---|---|
static BodyFilter |
accessToken() |
static BodyFilter |
replaceJsonNumberProperty(Predicate<String> predicate,
Number replacement) |
static BodyFilter |
replaceJsonNumberProperty(Set<String> properties,
Number replacement) |
static BodyFilter |
replaceJsonStringProperty(Predicate<String> predicate,
String replacement) |
static BodyFilter |
replaceJsonStringProperty(Set<String> properties,
String replacement)
Creates a
BodyFilter that replaces the properties in the json response with the replacement passed as argument. |
static BodyFilter |
replacePrimitiveJsonProperty(Predicate<String> predicate,
BiFunction<String,String,String> replacement) |
static BodyFilter |
replacePrimitiveJsonProperty(Predicate<String> predicate,
String replacement) |
@API(status=MAINTAINED) public static BodyFilter accessToken()
@API(status=MAINTAINED) public static BodyFilter replaceJsonStringProperty(Set<String> properties, String replacement)
BodyFilter that replaces the properties in the json response with the replacement passed as argument.
This BodyFilter works on all levels inside the json tree and it only works with string valuesAccessTokenBodyFilter method:
Set<String> properties = new HashSet<>();
properties.add("access_token");
properties.add("open_id");
properties.add("id_token");
return replaceJsonStringProperty(properties, "XXX");
properties - JSON properties to replacereplacement - String to replace the properties values@API(status=EXPERIMENTAL) public static BodyFilter replaceJsonStringProperty(Predicate<String> predicate, String replacement)
@API(status=EXPERIMENTAL) public static BodyFilter replaceJsonNumberProperty(Set<String> properties, Number replacement)
@API(status=EXPERIMENTAL) public static BodyFilter replaceJsonNumberProperty(Predicate<String> predicate, Number replacement)
@API(status=EXPERIMENTAL) public static BodyFilter replacePrimitiveJsonProperty(Predicate<String> predicate, String replacement)
@API(status=EXPERIMENTAL) public static BodyFilter replacePrimitiveJsonProperty(Predicate<String> predicate, BiFunction<String,String,String> replacement)
Copyright © 2015–2021 Zalando SE. All rights reserved.