java.lang.Object
co.ankatech.keymanagement.client.keymanagement.invoker.StringUtil

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.23.0") public class StringUtil extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final List<String>
    The request and response headers an HTTP debug log withholds: the credential headers, the DPoP proof (RFC 9449, which carries the access-token hash and is a credential until its jti is spent), the PQC transport session identifier and the usage-export handle, each of which authorizes a request on its own.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    containsIgnoreCase(String[] array, String value)
    Check if the given array contains the given value (with case-insensitive comparison).
    static String
    describeJson(com.google.gson.JsonElement element)
    Describe the shape of a JSON element without quoting any of its content, for the message of an exception a generated model's validation throws.
    static String
    join(String[] array, String separator)
    Join an array of strings with the given separator.
    static String
    join(Collection<String> list, String separator)
    Join a list of strings with the given separator.
    static String
    Render a sensitive value as a marker that keeps its presence and, for a string or a collection, its size, and none of its content.
    static String
    Render a password, or any property published as format: password, as a bare marker that keeps its presence and nothing else.
    static String
    Render a URL that carries a token in its query: scheme, host, port and path stay, while the user information, every query value and the fragment are replaced by a marker.
    static Object
    redactIfSensitive(String serializedName, Object value)
    Return what a model's toString() renders for a property: the value itself, or a redaction marker when the property is listed as sensitive.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SENSITIVE_HEADERS

      public static final List<String> SENSITIVE_HEADERS
      The request and response headers an HTTP debug log withholds: the credential headers, the DPoP proof (RFC 9449, which carries the access-token hash and is a credential until its jti is spent), the PQC transport session identifier and the usage-export handle, each of which authorizes a request on its own.
  • Constructor Details

    • StringUtil

      public StringUtil()
  • Method Details

    • containsIgnoreCase

      public static boolean containsIgnoreCase(String[] array, String value)
      Check if the given array contains the given value (with case-insensitive comparison).
      Parameters:
      array - The array
      value - The value to search
      Returns:
      true if the array contains the value
    • join

      public static String join(String[] array, String separator)
      Join an array of strings with the given separator.

      Note: This might be replaced by utility method from commons-lang or guava someday if one of those libraries is added as dependency.

      Parameters:
      array - The array of strings
      separator - The separator
      Returns:
      the resulting string
    • join

      public static String join(Collection<String> list, String separator)
      Join a list of strings with the given separator.
      Parameters:
      list - The list of strings
      separator - The separator
      Returns:
      the resulting string
    • redactIfSensitive

      public static Object redactIfSensitive(String serializedName, Object value)
      Return what a model's toString() renders for a property: the value itself, or a redaction marker when the property is listed as sensitive. A boolean or a number carries no secret, so a flag that shares a sensitive name (a secret: true marker) stays visible, and a nested generated model redacts its own sensitive members, so an outer block such as a credential stays visible too.
      Parameters:
      serializedName - The property's name on the wire
      value - The property's value
      Returns:
      the value, or its redaction marker
    • redacted

      public static String redacted(Object value)
      Render a sensitive value as a marker that keeps its presence and, for a string or a collection, its size, and none of its content.
      Parameters:
      value - The sensitive value
      Returns:
      null when the value is absent, otherwise the redaction marker
    • redactedPassword

      public static String redactedPassword(Object value)
      Render a password, or any property published as format: password, as a bare marker that keeps its presence and nothing else.
      Parameters:
      value - The password
      Returns:
      null when the value is absent, otherwise [REDACTED]
    • redactedUrl

      public static String redactedUrl(Object value)
      Render a URL that carries a token in its query: scheme, host, port and path stay, while the user information, every query value and the fragment are replaced by a marker. A value that is not an absolute hierarchical URL is redacted whole.
      Parameters:
      value - The URL, as a URI or a string
      Returns:
      null when the value is absent, otherwise the redacted URL
    • describeJson

      public static String describeJson(com.google.gson.JsonElement element)
      Describe the shape of a JSON element without quoting any of its content, for the message of an exception a generated model's validation throws.
      Parameters:
      element - The JSON element that failed validation
      Returns:
      its JSON type and size, never its value