public class CompoundHandler extends java.lang.Object implements java.util.function.Predicate<org.openqa.selenium.remote.http.HttpRequest>, CommandHandler
CommandHandler
s as a single unit. Should there be more than one
handler that responds to a given HttpRequest
, then the last one returned from the
underlying Map
's key set will be returned (that is, if the map preserves insertion order
the last inserted handler will be returned). This means that handlers added later take precedence
over handlers added first, allowing them to be overridden.Constructor and Description |
---|
CompoundHandler(Injector injector,
java.util.Map<java.util.function.Predicate<org.openqa.selenium.remote.http.HttpRequest>,java.util.function.BiFunction<Injector,org.openqa.selenium.remote.http.HttpRequest,CommandHandler>> handlers) |
Modifier and Type | Method and Description |
---|---|
void |
execute(org.openqa.selenium.remote.http.HttpRequest req,
org.openqa.selenium.remote.http.HttpResponse resp) |
boolean |
test(org.openqa.selenium.remote.http.HttpRequest request) |
public CompoundHandler(Injector injector, java.util.Map<java.util.function.Predicate<org.openqa.selenium.remote.http.HttpRequest>,java.util.function.BiFunction<Injector,org.openqa.selenium.remote.http.HttpRequest,CommandHandler>> handlers)
public boolean test(org.openqa.selenium.remote.http.HttpRequest request)
test
in interface java.util.function.Predicate<org.openqa.selenium.remote.http.HttpRequest>
public void execute(org.openqa.selenium.remote.http.HttpRequest req, org.openqa.selenium.remote.http.HttpResponse resp) throws java.io.IOException
execute
in interface CommandHandler
java.io.IOException