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

graphql.language.ArrayValue Maven / Gradle / Ivy

package graphql.language;


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

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

public class ArrayValue extends AbstractNode implements Value {

    private List values = new ArrayList<>();

    public ArrayValue() {
        this(new ArrayList<>());
    }

    public ArrayValue(List values) {
        this.values = values;
    }

    public List getValues() {
        return values;
    }

    public void setValues(List values) {
        this.values = values;
    }


    @Override
    public List getChildren() {
        return new ArrayList<>(values);
    }

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

        return true;
    }

    @Override
    public String toString() {
        return "ArrayValue{" +
                "values=" + values +
                '}';
    }

    @Override
    public ArrayValue deepCopy() {
        return new ArrayValue(deepCopy(values));
    }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy