Repository navigation
Expand file tree
/
Copy pathInterfaceTypeDefinition.java
More file actions
87 lines (69 loc) · 2.36 KB
/
Copy pathInterfaceTypeDefinition.java
File metadata and controls
87 lines (69 loc) · 2.36 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
package graphql.language;
import graphql.util.TraversalControl;
import graphql.util.TraverserContext;
import java.util.ArrayList;
import java.util.List;
public class InterfaceTypeDefinition extends AbstractNode<InterfaceTypeDefinition> implements TypeDefinition<InterfaceTypeDefinition>, DirectivesContainer<InterfaceTypeDefinition> {
private final String name;
private Description description;
private final List<FieldDefinition> definitions;
private final List<Directive> directives;
public InterfaceTypeDefinition(String name) {
this(name, new ArrayList<>(), new ArrayList<>());
}
public InterfaceTypeDefinition(String name, List<FieldDefinition> definitions, List<Directive> directives) {
this.name = name;
this.definitions = definitions;
this.directives = directives;
}
public List<FieldDefinition> getFieldDefinitions() {
return definitions;
}
@Override
public List<Directive> getDirectives() {
return directives;
}
@Override
public String getName() {
return name;
}
public Description getDescription() {
return description;
}
public void setDescription(Description description) {
this.description = description;
}
@Override
public List<Node> getChildren() {
List<Node> result = new ArrayList<>();
result.addAll(definitions);
result.addAll(directives);
return result;
}
@Override
public boolean isEqualTo(Node o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
InterfaceTypeDefinition that = (InterfaceTypeDefinition) o;
return NodeUtil.isEqualTo(this.name, that.name);
}
@Override
public InterfaceTypeDefinition deepCopy() {
return new InterfaceTypeDefinition(name,
deepCopy(definitions),
deepCopy(directives)
);
}
@Override
public String toString() {
return "InterfaceTypeDefinition{" +
"name='" + name + '\'' +
", fieldDefinitions=" + definitions +
", directives=" + directives +
'}';
}
@Override
public TraversalControl accept(TraverserContext<Node> context, NodeVisitor visitor) {
return visitor.visitInterfaceTypeDefinition(this, context);
}
}