Package org.apache.sling.graphql.helpers

# Class GenericConnection<T>

java.lang.Object
org.apache.sling.graphql.helpers.GenericConnection<T>

All Implemented Interfaces:
  `Connection<T>`, `PageInfo`

@ConsumerType public final class GenericConnection<T> extends Object implements Connection<T>, PageInfo
As per https://relay.dev/graphql/connections.htm a "connection" is a page of results for a paginated query. Use the `GenericConnection.Builder` class to build a Connection that outputs the supplied data, optionally sliced based on a "start after" cursor and a limit on the number of items output.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`GenericConnection.Builder<T>`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`DEFAULT_LIMIT`
`static final int`
`MAX_LIMIT`
We might make this configurable but for now let's stay on the safe side

## Method Summary

Modifier and Type
Method
Description
`@NotNull Iterable<Edge<T>>`
`getEdges()`
`@NotNull Cursor`
`getEndCursor()`
`@NotNull PageInfo`
`getPageInfo()`
`@NotNull Cursor`
`getStartCursor()`
`boolean`
`isHasNextPage()`
`boolean`
`isHasPreviousPage()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### DEFAULT_LIMIT

public static final int DEFAULT_LIMIT

See Also:
  - Constant Field Values

### MAX_LIMIT

public static final int MAX_LIMIT
We might make this configurable but for now let's stay on the safe side

See Also:
  - Constant Field Values

## Method Details

### getEdges

@NotNull public @NotNull Iterable<Edge<T>> getEdges()

Specified by:
  `getEdges` in interface `Connection<T>`

### getPageInfo

@NotNull public @NotNull PageInfo getPageInfo()

Specified by:
  `getPageInfo` in interface `Connection<T>`

### getStartCursor

@NotNull public @NotNull Cursor getStartCursor()

Specified by:
  `getStartCursor` in interface `PageInfo`

### getEndCursor

@NotNull public @NotNull Cursor getEndCursor()

Specified by:
  `getEndCursor` in interface `PageInfo`

### isHasPreviousPage

public boolean isHasPreviousPage()

Specified by:
  `isHasPreviousPage` in interface `PageInfo`

### isHasNextPage

public boolean isHasNextPage()

Specified by:
  `isHasNextPage` in interface `PageInfo`