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

graphql.language.IgnoredChars Maven / Gradle / Ivy

There is a newer version: 230521-nf-execution
Show newest version
package graphql.language;

import com.google.common.collect.ImmutableList;
import graphql.PublicApi;

import java.io.Serializable;
import java.util.List;

import static graphql.collect.ImmutableKit.emptyList;

/**
 * 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(emptyList(), 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