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

graphql.language.DirectiveDefinition Maven / Gradle / Ivy

The newest version!
package graphql.language;


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

public class DirectiveDefinition extends AbstractNode implements Definition {
    private String name;
    private List inputValueDefinitions = new ArrayList<>();
    private List directiveLocations = new ArrayList<>();

    public DirectiveDefinition(String name) {
        this.name = name;
    }

    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;

        if (null == name) {
            if (null != that.name) return false;
        } else if (!name.equals(that.name)) {
            return false;
        }
        return true;
    }


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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy