Record Class ExchangeListQuery

java.lang.Object
java.lang.Record
co.ankatech.ankasecure.keymanagement.query.ExchangeListQuery
Record Components:
status - DRAFT, READY, ACTIVE, SUSPENDED, EXPIRED, REVOKED or CONSUMED; null for every status
counterparty - the counterparty name; null for every counterparty
applicationId - the application the exchange belongs to; null for every application
ownerPrincipalId - the exchange owner; null for every owner
nameSearch - a fragment of the exchange name; null for every name
page - the zero-based page number; null for the server default (0)
size - the page size; null for the server default (20)
sortBy - the property to sort by; null for the server default (modifiedAt)
sortDirection - ASC or DESC; null for the server default (DESC)

public record ExchangeListQuery(String status, String counterparty, UUID applicationId, UUID ownerPrincipalId, String nameSearch, Integer page, Integer size, String sortBy, String sortDirection) extends Record
The filters and page of an exchange listing (exchanges().list).

Its components are exactly the query parameters of the listExchanges operation; a null component sends nothing, so the server applies its default.


 ExchangeListQuery.firstPage().withStatus("ACTIVE").withNameSearch("payroll")
 
  • Constructor Details

    • ExchangeListQuery

      public ExchangeListQuery(String status, String counterparty, UUID applicationId, UUID ownerPrincipalId, String nameSearch, Integer page, Integer size, String sortBy, String sortDirection)
      Creates an instance of a ExchangeListQuery record class.
      Parameters:
      status - the value for the status record component
      counterparty - the value for the counterparty record component
      applicationId - the value for the applicationId record component
      ownerPrincipalId - the value for the ownerPrincipalId record component
      nameSearch - the value for the nameSearch record component
      page - the value for the page record component
      size - the value for the size record component
      sortBy - the value for the sortBy record component
      sortDirection - the value for the sortDirection record component
  • Method Details

    • firstPage

      public static ExchangeListQuery firstPage()
      Returns:
      the first page with the server's defaults and no filter
    • withStatus

      public ExchangeListQuery withStatus(String value)
      Parameters:
      value - the new status; null clears it
      Returns:
      a copy of this query with status replaced
    • withCounterparty

      public ExchangeListQuery withCounterparty(String value)
      Parameters:
      value - the new counterparty; null clears it
      Returns:
      a copy of this query with counterparty replaced
    • withApplicationId

      public ExchangeListQuery withApplicationId(UUID value)
      Parameters:
      value - the new applicationId; null clears it
      Returns:
      a copy of this query with applicationId replaced
    • withOwnerPrincipalId

      public ExchangeListQuery withOwnerPrincipalId(UUID value)
      Parameters:
      value - the new ownerPrincipalId; null clears it
      Returns:
      a copy of this query with ownerPrincipalId replaced
    • withNameSearch

      public ExchangeListQuery withNameSearch(String value)
      Parameters:
      value - the new nameSearch; null clears it
      Returns:
      a copy of this query with nameSearch replaced
    • withPage

      public ExchangeListQuery withPage(Integer value)
      Parameters:
      value - the new page; null clears it
      Returns:
      a copy of this query with page replaced
    • withSize

      public ExchangeListQuery withSize(Integer value)
      Parameters:
      value - the new size; null clears it
      Returns:
      a copy of this query with size replaced
    • withSortBy

      public ExchangeListQuery withSortBy(String value)
      Parameters:
      value - the new sortBy; null clears it
      Returns:
      a copy of this query with sortBy replaced
    • withSortDirection

      public ExchangeListQuery withSortDirection(String value)
      Parameters:
      value - the new sortDirection; null clears it
      Returns:
      a copy of this query with sortDirection replaced
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • status

      public String status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • counterparty

      public String counterparty()
      Returns the value of the counterparty record component.
      Returns:
      the value of the counterparty record component
    • applicationId

      public UUID applicationId()
      Returns the value of the applicationId record component.
      Returns:
      the value of the applicationId record component
    • ownerPrincipalId

      public UUID ownerPrincipalId()
      Returns the value of the ownerPrincipalId record component.
      Returns:
      the value of the ownerPrincipalId record component
    • nameSearch

      public String nameSearch()
      Returns the value of the nameSearch record component.
      Returns:
      the value of the nameSearch record component
    • page

      public Integer page()
      Returns the value of the page record component.
      Returns:
      the value of the page record component
    • size

      public Integer size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component
    • sortBy

      public String sortBy()
      Returns the value of the sortBy record component.
      Returns:
      the value of the sortBy record component
    • sortDirection

      public String sortDirection()
      Returns the value of the sortDirection record component.
      Returns:
      the value of the sortDirection record component