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

graphql.execution.nextgen.result.ExecutionResultNodePosition Maven / Gradle / Ivy

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

import graphql.Assert;
import graphql.Internal;

@Internal
public class ExecutionResultNodePosition {

    private final Integer index;
    private final String key;

    public ExecutionResultNodePosition(Integer index) {
        this.index = index;
        this.key = null;
    }

    public ExecutionResultNodePosition(String key) {
        this.index = null;
        this.key = key;
    }

    public static ExecutionResultNodePosition index(int index) {
        return new ExecutionResultNodePosition(index);
    }

    public static ExecutionResultNodePosition key(String key) {
        return new ExecutionResultNodePosition(key);
    }

    public int getIndex() {
        return Assert.assertNotNull(index);
    }

    public String getKey() {
        return Assert.assertNotNull(key);
    }

    @Override
    public String toString() {
        return index != null ? index.toString() : key;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy