Record Class KeyListQuery

java.lang.Object
java.lang.Record
co.ankatech.ankasecure.keymanagement.query.KeyListQuery
Record Components:
status - the projected key status: active, pending_rotation, rotated, expired, revoked, archived, deleted_logical (destroyed), suspended or pending_destruction; null for every status
origin - GENERATED or IMPORTED; null for both
restricted - only restricted keys (true) or only unrestricted ones (false); null for both
kty - the key type (for example ML-KEM, ML-DSA, EC, RSA, COMPOSITE); null for every type
conformance - ALL, CONFORMING or NON_CONFORMING with the tenant's algorithm policy; null for ALL
page - the zero-based page number; null for the server default (0)
size - the page size; null for the server default (25)
sort - sort criteria as property,ASC|DESC; null for the server default (createdAt,DESC)

public record KeyListQuery(String status, String origin, Boolean restricted, String kty, String conformance, Integer page, Integer size, List<String> sort) extends Record
The filters and page of a key listing (keys().list).

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


 KeyListQuery.firstPage().withStatus("active").withConformance("NON_CONFORMING")
 
  • Constructor Details

  • Method Details

    • firstPage

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

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

      public KeyListQuery withOrigin(String value)
      Parameters:
      value - the new origin; null clears it
      Returns:
      a copy of this query with origin replaced
    • withRestricted

      public KeyListQuery withRestricted(Boolean value)
      Parameters:
      value - the new restricted; null clears it
      Returns:
      a copy of this query with restricted replaced
    • withKty

      public KeyListQuery withKty(String value)
      Parameters:
      value - the new kty; null clears it
      Returns:
      a copy of this query with kty replaced
    • withConformance

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

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

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

      public KeyListQuery withSort(List<String> value)
      Parameters:
      value - the new sort; null clears it
      Returns:
      a copy of this query with sort 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
    • origin

      public String origin()
      Returns the value of the origin record component.
      Returns:
      the value of the origin record component
    • restricted

      public Boolean restricted()
      Returns the value of the restricted record component.
      Returns:
      the value of the restricted record component
    • kty

      public String kty()
      Returns the value of the kty record component.
      Returns:
      the value of the kty record component
    • conformance

      public String conformance()
      Returns the value of the conformance record component.
      Returns:
      the value of the conformance 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
    • sort

      public List<String> sort()
      Returns the value of the sort record component.
      Returns:
      the value of the sort record component