All Downloads are FREE. Search and download functionalities are using the official Maven repository.

graphql.language.SelectionSet Maven / Gradle / Ivy

There is a newer version: 230521-nf-execution
Show newest version
package graphql.language;


import graphql.util.TraversalControl;
import graphql.util.TraverserContext;

import java.util.ArrayList;
import java.util.List;

public class SelectionSet extends AbstractNode {

    private final List selections = new ArrayList<>();

    public List getSelections() {
        return selections;
    }

    public SelectionSet() {
    }

    public SelectionSet(List selections) {
        this.selections.addAll(selections);
    }

    @Override
    public List getChildren() {
        List result = new ArrayList<>();
        result.addAll(selections);
        return result;
    }

    @Override
    public boolean isEqualTo(Node o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SelectionSet that = (SelectionSet) o;

        return true;

    }

    @Override
    public SelectionSet deepCopy() {
        return new SelectionSet(deepCopy(selections));
    }

    @Override
    public String toString() {
        return "SelectionSet{" +
                "selections=" + selections +
                '}';
    }

    @Override
    public TraversalControl accept(TraverserContext context, NodeVisitor visitor) {
        return visitor.visitSelectionSet(this, context);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy