graphql.InvalidSyntaxError Maven / Gradle / Ivy
The newest version!
package graphql;
import graphql.language.SourceLocation;
import java.util.ArrayList;
import java.util.List;
public class InvalidSyntaxError implements GraphQLError {
private final List sourceLocations = new ArrayList<>();
public InvalidSyntaxError(SourceLocation sourceLocation) {
if (sourceLocation != null)
this.sourceLocations.add(sourceLocation);
}
public InvalidSyntaxError(List sourceLocations) {
if (sourceLocations != null) {
this.sourceLocations.addAll(sourceLocations);
}
}
@Override
public String getMessage() {
return "Invalid Syntax";
}
@Override
public List getLocations() {
return sourceLocations;
}
@Override
public ErrorType getErrorType() {
return ErrorType.InvalidSyntax;
}
@Override
public String toString() {
return "InvalidSyntaxError{" +
"sourceLocations=" + sourceLocations +
'}';
}
@Override
public boolean equals(Object o) {
return Helper.equals(this, o);
}
@Override
public int hashCode() {
return Helper.hashCode(this);
}
}