Skip to content

Commit 23caeaf

Browse files
committed
Throws the exceptions in the interface
1 parent ab46c24 commit 23caeaf

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

src/main/java/graphql/annotations/connection/simple/SimpleConnection.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33

44
import graphql.relay.Connection;
5+
import graphql.relay.Edge;
6+
import graphql.relay.PageInfo;
57

68
import java.util.List;
79

@@ -26,4 +28,14 @@ public interface SimpleConnection<T> extends Connection<T> {
2628
* @return The amount of entities
2729
*/
2830
long getTotalCount();
31+
32+
@Override
33+
default List<Edge<T>> getEdges() {
34+
throw new UnsupportedOperationException("Simple paging doesn't have edges");
35+
}
36+
37+
@Override
38+
default PageInfo getPageInfo() {
39+
throw new UnsupportedOperationException("Simple paging doesn't have page info");
40+
}
2941
}
Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
package graphql.annotations.connection.simple;
22

3-
import graphql.relay.Edge;
4-
import graphql.relay.PageInfo;
5-
6-
import java.util.List;
7-
83
public class SimplePaginatedDataImpl<T> extends AbstractSimplePaginatedData<T> {
94

105
private long totalCount;
@@ -18,14 +13,4 @@ public SimplePaginatedDataImpl(Iterable<T> data, long totalCount) {
1813
public long getTotalCount() {
1914
return totalCount;
2015
}
21-
22-
@Override
23-
public List<Edge<T>> getEdges() {
24-
throw new UnsupportedOperationException("Simple paging doesn't have edges");
25-
}
26-
27-
@Override
28-
public PageInfo getPageInfo() {
29-
throw new UnsupportedOperationException("Simple paging doesn't have page info");
30-
}
3116
}

0 commit comments

Comments
 (0)