Record Class KeyPage

java.lang.Object
java.lang.Record
co.ankatech.ankasecure.sdk.model.KeyPage
Record Components:
content - the keys on this page; never null, may be empty
totalElements - total keys matching the filters across all pages
totalPages - total pages at the requested page size
number - zero-based index of this page

public record KeyPage(List<KeyMetadata> content, long totalElements, int totalPages, int number) extends Record
One page of a key listing, mirroring the server's paginated envelope.

totalElements/totalPages are computed by the server over the FILTERED, tenant-scoped set (filters apply before pagination). A number beyond the last page yields an empty content with the true totals.

Since:
3.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    KeyPage(List<KeyMetadata> content, long totalElements, int totalPages, int number)
    Creates an instance of a KeyPage record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the content record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    true when this is the last page (or the listing is empty).
    int
    Returns the value of the number record component.
    final String
    Returns a string representation of this record class.
    long
    Returns the value of the totalElements record component.
    int
    Returns the value of the totalPages record component.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • KeyPage

      public KeyPage(List<KeyMetadata> content, long totalElements, int totalPages, int number)
      Creates an instance of a KeyPage record class.
      Parameters:
      content - the value for the content record component
      totalElements - the value for the totalElements record component
      totalPages - the value for the totalPages record component
      number - the value for the number record component
  • Method Details

    • last

      public boolean last()
      true when this is the last page (or the listing is empty).
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • content

      public List<KeyMetadata> content()
      Returns the value of the content record component.
      Returns:
      the value of the content record component
    • totalElements

      public long totalElements()
      Returns the value of the totalElements record component.
      Returns:
      the value of the totalElements record component
    • totalPages

      public int totalPages()
      Returns the value of the totalPages record component.
      Returns:
      the value of the totalPages record component
    • number

      public int number()
      Returns the value of the number record component.
      Returns:
      the value of the number record component