Class StringUtil
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
FieldsModifier and TypeFieldDescriptionThe 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 -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsIgnoreCase(String[] array, String value) Check if the given array contains the given value (with case-insensitive comparison).static StringdescribeJson(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 StringJoin an array of strings with the given separator.static Stringjoin(Collection<String> list, String separator) Join a list of strings with the given separator.static StringRender 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 StringredactedPassword(Object value) Render a password, or any property published asformat: password, as a bare marker that keeps its presence and nothing else.static StringredactedUrl(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.static ObjectredactIfSensitive(String serializedName, Object value) Return what a model'stoString()renders for a property: the value itself, or a redaction marker when the property is listed as sensitive.
-
Field Details
-
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
Check if the given array contains the given value (with case-insensitive comparison).- Parameters:
array- The arrayvalue- The value to search- Returns:
- true if the array contains the value
-
join
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 stringsseparator- The separator- Returns:
- the resulting string
-
join
Join a list of strings with the given separator.- Parameters:
list- The list of stringsseparator- The separator- Returns:
- the resulting string
-
redactIfSensitive
Return what a model'stoString()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 (asecret: truemarker) stays visible, and a nested generated model redacts its own sensitive members, so an outer block such as acredentialstays visible too.- Parameters:
serializedName- The property's name on the wirevalue- The property's value- Returns:
- the value, or its redaction marker
-
redacted
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:
nullwhen the value is absent, otherwise the redaction marker
-
redactedPassword
Render a password, or any property published asformat: password, as a bare marker that keeps its presence and nothing else.- Parameters:
value- The password- Returns:
nullwhen the value is absent, otherwise[REDACTED]
-
redactedUrl
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 aURIor a string- Returns:
nullwhen the value is absent, otherwise the redacted URL
-
describeJson
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
-