org.zalando.logbook.BodyReplacer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of logbook-api Show documentation
Show all versions of logbook-api Show documentation
HTTP request and response logging
package org.zalando.logbook;
import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.Objects;
@FunctionalInterface
public interface BodyReplacer {
@Nullable
String replace(final T message);
@SafeVarargs
static BodyReplacer compound(final BodyReplacer... replacers) {
return message -> Arrays.stream(replacers)
.map(replacer -> replacer.replace(message))
.filter(Objects::nonNull)
.findFirst()
.orElse(null);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy