Skip to content

Commit a6e7382

Browse files
committed
Annotate DefaultPageInfo
1 parent 0bee1f8 commit a6e7382

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/main/java/graphql/relay/DefaultPageInfo.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,34 @@
22

33

44
import graphql.PublicApi;
5+
import org.jspecify.annotations.NullMarked;
6+
import org.jspecify.annotations.Nullable;
57

68
import java.util.Objects;
79

810
@PublicApi
11+
@NullMarked
912
public class DefaultPageInfo implements PageInfo {
1013

11-
private final ConnectionCursor startCursor;
12-
private final ConnectionCursor endCursor;
14+
private final @Nullable ConnectionCursor startCursor;
15+
private final @Nullable ConnectionCursor endCursor;
1316
private final boolean hasPreviousPage;
1417
private final boolean hasNextPage;
1518

16-
public DefaultPageInfo(ConnectionCursor startCursor, ConnectionCursor endCursor, boolean hasPreviousPage, boolean hasNextPage) {
19+
public DefaultPageInfo(@Nullable ConnectionCursor startCursor, @Nullable ConnectionCursor endCursor, boolean hasPreviousPage, boolean hasNextPage) {
1720
this.startCursor = startCursor;
1821
this.endCursor = endCursor;
1922
this.hasPreviousPage = hasPreviousPage;
2023
this.hasNextPage = hasNextPage;
2124
}
2225

2326
@Override
24-
public ConnectionCursor getStartCursor() {
27+
public @Nullable ConnectionCursor getStartCursor() {
2528
return startCursor;
2629
}
2730

28-
2931
@Override
30-
public ConnectionCursor getEndCursor() {
32+
public @Nullable ConnectionCursor getEndCursor() {
3133
return endCursor;
3234
}
3335

@@ -42,7 +44,7 @@ public boolean isHasNextPage() {
4244
}
4345

4446
@Override
45-
public boolean equals(Object o) {
47+
public boolean equals(@Nullable Object o) {
4648
if (this == o) {
4749
return true;
4850
}

src/test/groovy/graphql/archunit/JSpecifyAnnotationsCheck.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ class JSpecifyAnnotationsCheck extends Specification {
190190
"graphql.parser.Parser",
191191
"graphql.parser.ParserEnvironment",
192192
"graphql.parser.ParserOptions",
193-
"graphql.relay.DefaultPageInfo",
194193
"graphql.relay.Edge",
195194
"graphql.relay.PageInfo",
196195
"graphql.relay.Relay",

0 commit comments

Comments
 (0)