forked from graphql-java/graphql-java
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathField.java
More file actions
121 lines (89 loc) · 2.83 KB
/
Field.java
File metadata and controls
121 lines (89 loc) · 2.83 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package graphql.language;
import java.util.ArrayList;
import java.util.List;
public class Field extends AbstractNode implements Selection {
private String name;
private String alias;
private List<Argument> arguments = new ArrayList<Argument>();
private List<Directive> directives = new ArrayList<Directive>();
private SelectionSet selectionSet;
public Field() {
}
public Field(String name) {
this.name = name;
}
public Field(String name, SelectionSet selectionSet) {
this.name = name;
this.selectionSet = selectionSet;
}
public Field(String name, List<Argument> arguments) {
this.name = name;
this.arguments = arguments;
}
public Field(String name, List<Argument> arguments, List<Directive> directives) {
this.name = name;
this.arguments = arguments;
this.directives = directives;
}
public Field(String name, List<Argument> arguments, SelectionSet selectionSet) {
this.name = name;
this.arguments = arguments;
this.selectionSet = selectionSet;
}
@Override
public List<Node> getChildren() {
List<Node> result = new ArrayList<Node>();
result.addAll(arguments);
result.addAll(directives);
if (selectionSet != null) result.add(selectionSet);
return result;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAlias() {
return alias;
}
public void setAlias(String alias) {
this.alias = alias;
}
public List<Argument> getArguments() {
return arguments;
}
public void setArguments(List<Argument> arguments) {
this.arguments = arguments;
}
public List<Directive> getDirectives() {
return directives;
}
public void setDirectives(List<Directive> directives) {
this.directives = directives;
}
public SelectionSet getSelectionSet() {
return selectionSet;
}
public void setSelectionSet(SelectionSet selectionSet) {
this.selectionSet = selectionSet;
}
@Override
public boolean isEqualTo(Node o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Field field = (Field) o;
if (name != null ? !name.equals(field.name) : field.name != null) return false;
return !(alias != null ? !alias.equals(field.alias) : field.alias != null);
}
@Override
public String toString() {
return "Field{" +
"name='" + name + '\'' +
", alias='" + alias + '\'' +
", arguments=" + arguments +
", directives=" + directives +
", selectionSet=" + selectionSet +
'}';
}
}