graphql.language.SchemaDefinition Maven / Gradle / Ivy
package graphql.language;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static graphql.language.NodeUtil.directivesByName;
public class SchemaDefinition extends AbstractNode implements Definition {
private final List directives = new ArrayList<>();
private final List operationTypeDefinitions = new ArrayList<>();
public SchemaDefinition() {
}
public List getDirectives() {
return directives;
}
public Map getDirectivesByName() {
return directivesByName(directives);
}
public Directive getDirective(String directiveName) {
return getDirectivesByName().get(directiveName);
}
public List getOperationTypeDefinitions() {
return operationTypeDefinitions;
}
@Override
public List getChildren() {
List result = new ArrayList<>();
result.addAll(directives);
result.addAll(operationTypeDefinitions);
return result;
}
@Override
public boolean isEqualTo(Node o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SchemaDefinition that = (SchemaDefinition) o;
return true;
}
@Override
public String toString() {
return "SchemaDefinition{" +
"directives=" + directives +
", operationTypeDefinitions=" + operationTypeDefinitions +
"}";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy