graphql.language.IgnoredChars Maven / Gradle / Ivy
package graphql.language;
import com.google.common.collect.ImmutableList;
import graphql.PublicApi;
import graphql.collect.ImmutableKit;
import java.io.Serializable;
import java.util.List;
/**
* Graphql syntax has a series of characters, such as spaces, new lines and commas that are not considered relevant
* to the syntax. However they can be captured and associated with the AST elements they belong to.
*
* This costs more memory but for certain use cases (like editors) this maybe be useful
*/
@PublicApi
public class IgnoredChars implements Serializable {
private final ImmutableList left;
private final ImmutableList right;
public static final IgnoredChars EMPTY = new IgnoredChars(ImmutableKit.emptyList(), ImmutableKit.emptyList());
public IgnoredChars(List left, List right) {
this.left = ImmutableList.copyOf(left);
this.right = ImmutableList.copyOf(right);
}
public List getLeft() {
return left;
}
public List getRight() {
return right;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy