graphql.language.DirectiveLocation Maven / Gradle / Ivy
The newest version!
package graphql.language;
import java.util.ArrayList;
import java.util.List;
// This should probably be an enum... but the grammar
// doesn't enforce the names. These are the current names:
// QUERY
// MUTATION
// FIELD
// FRAGMENT_DEFINITION
// FRAGMENT_SPREAD
// INLINE_FRAGMENT
public class DirectiveLocation extends AbstractNode {
private String name;
public DirectiveLocation(String name) {
this.name = name;
}
public String getName() {
return name;
}
@Override
public List getChildren() {
List result = new ArrayList<>();
return result;
}
@Override
public boolean isEqualTo(Node o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DirectiveLocation that = (DirectiveLocation) 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 "DirectiveLocation{" +
"name='" + name + "'" +
"}";
}
}