Package com.fauna.types
Class Page<T>
- java.lang.Object
-
- com.fauna.types.Page<T>
-
- Type Parameters:
T
- The type of data contained within the page.
public final class Page<T> extends java.lang.Object
Represents a page of data in a Fauna Set. Supports pagination with an optional `after` token for retrieving additional pages.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Checks if this page is equal to another object.java.util.Optional<AfterToken>
getAfter()
Retrieves the optional after token for pagination.java.util.List<T>
getData()
Retrieves the data items contained in this page.int
hashCode()
Returns a hash code value for this page based on its data and after token.
-
-
-
Constructor Detail
-
Page
public Page(java.util.List<T> data, java.lang.String after)
Constructs aPage
with the specified data and an optional after token.- Parameters:
data
- The list of data items belonging to this page.after
- The after token for pagination, which may be null if there are no more pages.
-
-
Method Detail
-
getData
public java.util.List<T> getData()
Retrieves the data items contained in this page.- Returns:
- A
List<T>
of data items belonging to this page.
-
getAfter
public java.util.Optional<AfterToken> getAfter()
Retrieves the optional after token for pagination. If present, this token can be used to request the next page of results from Fauna.- Returns:
- An
Optional<AfterToken>
representing the after token, or an emptyOptional
if no token is present.
-
equals
public boolean equals(java.lang.Object o)
Checks if this page is equal to another object. Two pages are considered equal if they have the same data and after token.- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- The object to compare with this page for equality.- Returns:
true
if the specified object is equal to this page; otherwise,false
.
-
hashCode
public int hashCode()
Returns a hash code value for this page based on its data and after token.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- An integer hash code for this page.
-
-