graphql.ExecutionInput Maven / Gradle / Ivy
package graphql;
import java.util.Collections;
import java.util.Map;
@PublicApi
public class ExecutionInput {
private final String query;
private final String operationName;
private final Object context;
private final Object root;
private final Map variables;
public ExecutionInput(String query, String operationName, Object context, Object root, Map variables) {
this.query = query;
this.operationName = operationName;
this.context = context;
this.root = root;
this.variables = variables;
}
public String getQuery() {
return query;
}
public String getOperationName() {
return operationName;
}
public Object getContext() {
return context;
}
public Object getRoot() {
return root;
}
public Map getVariables() {
return variables;
}
@Override
public String toString() {
return "ExecutionInput{" +
"query='" + query + '\'' +
", operationName='" + operationName + '\'' +
", context=" + context +
", root=" + root +
", variables=" + variables +
'}';
}
public static Builder newExecutionInput() {
return new Builder();
}
public static class Builder {
private String query;
private String operationName;
private Object context;
private Object root;
private Map variables = Collections.emptyMap();
public Builder query(String query) {
this.query = query;
return this;
}
public Builder operationName(String operationName) {
this.operationName = operationName;
return this;
}
public Builder context(Object context) {
this.context = context;
return this;
}
public Builder root(Object root) {
this.root = root;
return this;
}
public Builder variables(Map variables) {
this.variables = variables;
return this;
}
public ExecutionInput build() {
return new ExecutionInput(query, operationName, context, root, variables);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy