Record Class Page<T>

java.lang.Object
java.lang.Record
kr.paysync.sdk.Page<T>
Type Parameters:
T - 항목 타입
Record Components:
items - 이 페이지의 항목
totalItems - 조건에 맞는 전체 항목 수
offset - 이 페이지를 조회할 때 건너뛴 항목 수
limit - 이 페이지를 조회할 때 요청한 항목 수

public record Page<T>(List<T> items, long totalItems, long offset, int limit) extends Record
목록 조회 결과 한 페이지입니다.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Page(List<T> items, long totalItems, long offset, int limit)
    Creates an instance of a Page record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    다음 페이지가 있으면 true입니다.
    Returns the value of the items record component.
    int
    Returns the value of the limit record component.
    long
    다음 페이지를 조회할 때 쓸 offset입니다.
    long
    Returns the value of the offset record component.
    final String
    Returns a string representation of this record class.
    long
    Returns the value of the totalItems record component.

    Methods inherited from class Object

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

    • Page

      public Page(List<T> items, long totalItems, long offset, int limit)
      Creates an instance of a Page record class.
      Parameters:
      items - the value for the items record component
      totalItems - the value for the totalItems record component
      offset - the value for the offset record component
      limit - the value for the limit record component
  • Method Details

    • hasNextPage

      public boolean hasNextPage()
      다음 페이지가 있으면 true입니다.
    • nextOffset

      public long nextOffset()
      다음 페이지를 조회할 때 쓸 offset입니다.
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • items

      public List<T> items()
      Returns the value of the items record component.
      Returns:
      the value of the items record component
    • totalItems

      public long totalItems()
      Returns the value of the totalItems record component.
      Returns:
      the value of the totalItems record component
    • offset

      public long offset()
      Returns the value of the offset record component.
      Returns:
      the value of the offset record component
    • limit

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