forked from graphql-java/graphql-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExecutionResultImpl.java
More file actions
44 lines (31 loc) · 921 Bytes
/
ExecutionResultImpl.java
File metadata and controls
44 lines (31 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package graphql;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class ExecutionResultImpl implements ExecutionResult {
private final List<GraphQLError> errors = new ArrayList<>();
private Object data;
public ExecutionResultImpl(List<? extends GraphQLError> errors) {
this.errors.addAll(errors);
}
public ExecutionResultImpl(Object data, List<? extends GraphQLError> errors) {
this.data = data;
if (errors != null) {
this.errors.addAll(errors);
}
}
public void addErrors(List<? extends GraphQLError> errors) {
this.errors.addAll(errors);
}
@Override
public Object getData() {
return data;
}
public void setData(Object result) {
this.data = result;
}
@Override
public List<GraphQLError> getErrors() {
return new ArrayList<>(errors);
}
}