public class ExecutionResultImpl extends java.lang.Object implements ExecutionResult
| Modifier and Type | Class and Description |
|---|---|
static class |
ExecutionResultImpl.Builder |
| Constructor and Description |
|---|
ExecutionResultImpl(ExecutionResultImpl other) |
ExecutionResultImpl(GraphQLError error) |
ExecutionResultImpl(java.util.List<? extends GraphQLError> errors) |
ExecutionResultImpl(java.lang.Object data,
java.util.List<? extends GraphQLError> errors) |
ExecutionResultImpl(java.lang.Object data,
java.util.List<? extends GraphQLError> errors,
java.util.Map<java.lang.Object,java.lang.Object> extensions) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
getData() |
java.util.List<GraphQLError> |
getErrors() |
java.util.Map<java.lang.Object,java.lang.Object> |
getExtensions() |
boolean |
isDataPresent()
The graphql specification specifies:
"If an error was encountered before execution begins, the data entry should not be present in the result.
|
static ExecutionResultImpl.Builder |
newExecutionResult() |
java.util.Map<java.lang.String,java.lang.Object> |
toSpecification()
The graphql specification says that result of a call should be a map that follows certain rules on what items
should be present.
|
java.lang.String |
toString() |
ExecutionResultImpl |
transform(java.util.function.Consumer<ExecutionResultImpl.Builder> builderConsumer) |
public ExecutionResultImpl(GraphQLError error)
public ExecutionResultImpl(java.util.List<? extends GraphQLError> errors)
public ExecutionResultImpl(java.lang.Object data,
java.util.List<? extends GraphQLError> errors)
public ExecutionResultImpl(java.lang.Object data,
java.util.List<? extends GraphQLError> errors,
java.util.Map<java.lang.Object,java.lang.Object> extensions)
public ExecutionResultImpl(ExecutionResultImpl other)
public boolean isDataPresent()
ExecutionResultExecutionResult.getData() returns null.
See : https://graphql.github.io/graphql-spec/June2018/#sec-DataisDataPresent in interface ExecutionResulttrue if the entry "data" should be present in the result
false otherwisepublic java.util.List<GraphQLError> getErrors()
getErrors in interface ExecutionResultpublic <T> T getData()
getData in interface ExecutionResultT - allows type coercionpublic java.util.Map<java.lang.Object,java.lang.Object> getExtensions()
getExtensions in interface ExecutionResultpublic java.util.Map<java.lang.String,java.lang.Object> toSpecification()
ExecutionResultExecutionResult to spec, so this method
is provided to produce a map that strictly follows the specification.
See : http://facebook.github.io/graphql/#sec-Response-FormattoSpecification in interface ExecutionResultpublic java.lang.String toString()
toString in class java.lang.Objectpublic ExecutionResultImpl transform(java.util.function.Consumer<ExecutionResultImpl.Builder> builderConsumer)
public static ExecutionResultImpl.Builder newExecutionResult()