Class 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.
    • Constructor Summary

      Constructors 
      Constructor Description
      Page​(java.util.List<T> data, java.lang.String after)
      Constructs a Page with the specified data and an optional after token.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Page

        public Page​(java.util.List<T> data,
                    java.lang.String after)
        Constructs a Page 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 empty Optional 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 class java.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 class java.lang.Object
        Returns:
        An integer hash code for this page.