HiddenString

data class HiddenString(val value: String, placeholder: String = HIDDEN_STRING_PLACEHOLDER)(source)

Represents a string whose actual value is hidden when converted to a string representation.

This class is useful for scenarios where sensitive or confidential information needs to be obscured in logs or other outputs. The value is only accessible programmatically and will not be displayed in plain text when the toString method is called. The original value is accessible through a public value field.

Parameters

value

The original string value to be hidden.

placeholder

The placeholder text to display when the instance is converted to a string. Defaults to "HIDDEN:non-empty".

Constructors

Link copied to clipboard
constructor(value: String, placeholder: String = HIDDEN_STRING_PLACEHOLDER)

Types

Link copied to clipboard
object Companion

A companion object for holding constant values and shared logic associated with the enclosing class.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun toString(): String