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

graphql.language.InlineFragment Maven / Gradle / Ivy

The newest version!
package graphql.language;


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

public class InlineFragment extends AbstractNode implements Selection {
    private TypeName typeCondition;
    private List directives = new ArrayList<>();
    private SelectionSet selectionSet;

    public InlineFragment() {

    }

    public InlineFragment(TypeName typeCondition) {
        this.typeCondition = typeCondition;
    }

    public InlineFragment(TypeName typeCondition, List directives, SelectionSet selectionSet) {
        this.typeCondition = typeCondition;
        this.directives = directives;
        this.selectionSet = selectionSet;
    }

    public InlineFragment(TypeName typeCondition, SelectionSet selectionSet) {
        this.typeCondition = typeCondition;
        this.selectionSet = selectionSet;
    }


    public TypeName getTypeCondition() {
        return typeCondition;
    }

    public void setTypeCondition(TypeName typeCondition) {
        this.typeCondition = typeCondition;
    }

    public List getDirectives() {
        return directives;
    }

    public void setDirectives(List directives) {
        this.directives = directives;
    }

    public SelectionSet getSelectionSet() {
        return selectionSet;
    }

    public void setSelectionSet(SelectionSet selectionSet) {
        this.selectionSet = selectionSet;
    }

    @Override
    public List getChildren() {
        List result = new ArrayList<>();
        if (typeCondition != null) {
            result.add(typeCondition);
        }
        result.addAll(directives);
        result.add(selectionSet);
        return result;
    }

    @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 "InlineFragment{" +
                "typeCondition='" + typeCondition + '\'' +
                ", directives=" + directives +
                ", selectionSet=" + selectionSet +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy