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

com.qwlabs.graphql.relay.Edge Maven / Gradle / Ivy

There is a newer version: 0.2.354
Show newest version
package com.qwlabs.graphql.relay;

import graphql.PublicApi;

import javax.validation.constraints.NotNull;

import static graphql.Assert.assertNotNull;

@PublicApi
public class Edge {
    private final T node;

    private final String cursor;

    public Edge(T node, String cursor) {
        this.cursor = assertNotNull(cursor, () -> "cursor cannot be null");
        this.node = assertNotNull(node, () -> "node can not be null");
    }

    @NotNull
    public T getNode() {
        return node;
    }

    @NotNull
    public String getCursor() {
        return cursor;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy