io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler Maven / Gradle / Ivy
package io.vertx.mutiny.ext.web.handler.graphql;
import java.util.Map;
import java.util.stream.Collectors;
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;
import io.smallrye.mutiny.vertx.TypeArg;
import io.vertx.codegen.annotations.Fluent;
import io.smallrye.common.annotation.CheckReturnValue;
import io.vertx.core.Handler;
import java.util.function.Function;
import io.vertx.ext.web.handler.graphql.GraphiQLHandlerOptions;
/**
* A handler for GraphiQL resources.
*
*
* NOTE: This class has been automatically generated from the {@link io.vertx.ext.web.handler.graphql.GraphiQLHandler original} non Mutiny-ified interface using Vert.x codegen.
*/
@io.smallrye.mutiny.vertx.MutinyGen(io.vertx.ext.web.handler.graphql.GraphiQLHandler.class)
public class GraphiQLHandler implements io.vertx.core.Handler, java.util.function.Consumer {
public static final io.smallrye.mutiny.vertx.TypeArg __TYPE_ARG = new io.smallrye.mutiny.vertx.TypeArg<>( obj -> new GraphiQLHandler((io.vertx.ext.web.handler.graphql.GraphiQLHandler) obj),
GraphiQLHandler::getDelegate
);
private final io.vertx.ext.web.handler.graphql.GraphiQLHandler delegate;
public GraphiQLHandler(io.vertx.ext.web.handler.graphql.GraphiQLHandler delegate) {
this.delegate = delegate;
}
public GraphiQLHandler(Object delegate) {
this.delegate = (io.vertx.ext.web.handler.graphql.GraphiQLHandler)delegate;
}
/**
* Empty constructor used by CDI, do not use this constructor directly.
**/
GraphiQLHandler() {
this.delegate = null;
}
public io.vertx.ext.web.handler.graphql.GraphiQLHandler getDelegate() {
return delegate;
}
@Override
public String toString() {
return delegate.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GraphiQLHandler that = (GraphiQLHandler) o;
return delegate.equals(that.delegate);
}
@Override
public int hashCode() {
return delegate.hashCode();
}
public void handle(io.vertx.mutiny.ext.web.RoutingContext arg0) {
delegate.handle(arg0.getDelegate());
}
/**
* @param vertx
* @return
*/
public static io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandlerBuilder builder(io.vertx.mutiny.core.Vertx vertx) {
io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandlerBuilder ret = io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandlerBuilder.newInstance((io.vertx.ext.web.handler.graphql.GraphiQLHandlerBuilder)io.vertx.ext.web.handler.graphql.GraphiQLHandler.builder(vertx.getDelegate()));
return ret;
}
/**
* @param vertx
* @return
*/
public static io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler create(io.vertx.mutiny.core.Vertx vertx) {
io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler ret = io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler.newInstance((io.vertx.ext.web.handler.graphql.GraphiQLHandler)io.vertx.ext.web.handler.graphql.GraphiQLHandler.create(vertx.getDelegate()));
return ret;
}
/**
* @return
* @deprecated as of 4.5.1, use {@link #create(Vertx)}, with {@link #router()} */
@Deprecated
public static io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler create() {
io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler ret = io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler.newInstance((io.vertx.ext.web.handler.graphql.GraphiQLHandler)io.vertx.ext.web.handler.graphql.GraphiQLHandler.create());
return ret;
}
/**
* @param vertx
* @param options options for configuring the {@link io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler}
* @return
*/
public static io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler create(io.vertx.mutiny.core.Vertx vertx, io.vertx.ext.web.handler.graphql.GraphiQLHandlerOptions options) {
io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler ret = io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler.newInstance((io.vertx.ext.web.handler.graphql.GraphiQLHandler)io.vertx.ext.web.handler.graphql.GraphiQLHandler.create(vertx.getDelegate(), options));
return ret;
}
/**
* @param options options for configuring the {@link io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler}
* @return
* @deprecated as of 4.5.1, use {@link #create(Vertx, GraphiQLHandlerOptions)}, with {@link #router()} */
@Deprecated
public static io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler create(io.vertx.ext.web.handler.graphql.GraphiQLHandlerOptions options) {
io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler ret = io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler.newInstance((io.vertx.ext.web.handler.graphql.GraphiQLHandler)io.vertx.ext.web.handler.graphql.GraphiQLHandler.create(options));
return ret;
}
/**
* @return a router to be mounted on an existing {@link io.vertx.mutiny.ext.web.Route}
*/
public io.vertx.mutiny.ext.web.Router router() {
io.vertx.mutiny.ext.web.Router ret = io.vertx.mutiny.ext.web.Router.newInstance((io.vertx.ext.web.Router)delegate.router());
return ret;
}
/**
* @param factory
* @return a reference to this, so the API can be used fluently
* @deprecated as of 4.5.1, use {@link #builder(Vertx)} instead */
@Deprecated
@Fluent
public io.vertx.mutiny.ext.web.handler.graphql.GraphiQLHandler graphiQLRequestHeaders(Function factory) {
delegate.graphiQLRequestHeaders(new java.util.function.Function() {
public io.vertx.core.MultiMap apply(io.vertx.ext.web.RoutingContext arg) {
io.vertx.mutiny.core.MultiMap ret = factory.apply(io.vertx.mutiny.ext.web.RoutingContext.newInstance((io.vertx.ext.web.RoutingContext)arg));
return ret.getDelegate();
}
});
return this;
}
public void accept(io.vertx.mutiny.ext.web.RoutingContext item) {
handle(item);
}
public static GraphiQLHandler newInstance(io.vertx.ext.web.handler.graphql.GraphiQLHandler arg) {
return arg != null ? new GraphiQLHandler(arg) : null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy