io.hyperfoil.core.parser.Adapter Maven / Gradle / Ivy
package io.hyperfoil.core.parser;
import java.util.function.Function;
class Adapter implements Parser {
private final Function adapter;
private final Parser parser;
Adapter(Function adapter, Parser parser) {
this.adapter = adapter;
this.parser = parser;
}
@Override
public void parse(Context ctx, A target) throws ParserException {
parser.parse(ctx, adapter.apply(target));
}
}