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

graphql.language.DirectiveDefinition Maven / Gradle / Ivy

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


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

public class DirectiveDefinition extends AbstractNode implements Definition {
    private final String name;
    private final List inputValueDefinitions;
    private final List directiveLocations;

    public DirectiveDefinition(String name) {
        this(name, new ArrayList<>(), new ArrayList<>());
    }

    public DirectiveDefinition(String name, List inputValueDefinitions, List directiveLocations) {
        this.name = name;
        this.inputValueDefinitions = inputValueDefinitions;
        this.directiveLocations = directiveLocations;
    }

    public String getName() {
        return name;
    }

    public List getInputValueDefinitions() {
        return inputValueDefinitions;
    }

    public List getDirectiveLocations() {
        return directiveLocations;
    }

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

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

        DirectiveDefinition that = (DirectiveDefinition) o;

        return NodeUtil.isEqualTo(this.name, that.name);
    }

    @Override
    public DirectiveDefinition deepCopy() {
        return new DirectiveDefinition(name,
                deepCopy(inputValueDefinitions),
                deepCopy(directiveLocations));
    }

    @Override
    public String toString() {
        return "DirectiveDefinition{" +
                "name='" + name + "'" +
                ", inputValueDefinitions=" + inputValueDefinitions +
                ", directiveLocations=" + directiveLocations +
                "}";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy