Package graphql.relay
Class DefaultConnection<T>
- java.lang.Object
-
- graphql.relay.DefaultConnection<T>
-
- All Implemented Interfaces:
Connection<T>
@PublicApi public class DefaultConnection<T> extends java.lang.Object implements Connection<T>
A default implementation ofConnection
-
-
Constructor Summary
Constructors Constructor Description DefaultConnection(java.util.List<Edge<T>> edges, PageInfo pageInfo)
A connection consists of a list of edges and page info
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.util.List<Edge<T>>
getEdges()
PageInfo
getPageInfo()
int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
DefaultConnection
public DefaultConnection(java.util.List<Edge<T>> edges, PageInfo pageInfo)
A connection consists of a list of edges and page info- Parameters:
edges
- a non null list of edgespageInfo
- a non null page info- Throws:
java.lang.IllegalArgumentException
- if edges or page info is null. useCollections.emptyList()
for empty edges.
-
-
Method Detail
-
getEdges
public java.util.List<Edge<T>> getEdges()
- Specified by:
getEdges
in interfaceConnection<T>
- Returns:
- a list of
Edge
s that are really a node of data and its cursor
-
getPageInfo
public PageInfo getPageInfo()
- Specified by:
getPageInfo
in interfaceConnection<T>
- Returns:
PageInfo
pagination data about that list of edges
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-