Make RestChannelConsumer extend CheckedConsumer<RestChannel, Exception>
@@ -22,6 +22,7 @@ package org.elasticsearch.rest;
import org.apache.lucene.search.spell.LevensteinDistance;
import org.apache.lucene.util.CollectionUtil;
import org.elasticsearch.client.node.NodeClient;
+import org.elasticsearch.common.CheckedConsumer;
import org.elasticsearch.common.collect.Tuple;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.settings.Setting;
@@ -125,14 +126,7 @@ public abstract class BaseRestHandler extends AbstractComponent implements RestH
* the request against a channel.
*/
@FunctionalInterface
- protected interface RestChannelConsumer {
- /**
- * Executes a request against the given channel.
- *
- * @param channel the channel for sending the response
- * @throws Exception if an exception occurred executing the request
- */
- void accept(RestChannel channel) throws Exception;
+ protected interface RestChannelConsumer extends CheckedConsumer<RestChannel, Exception> {
}
/**
