Class MaskedString

  • All Implemented Interfaces:
    kotlin.CharSequence

    
    public final class MaskedString
     implements CharSequence
                        

    A class that wraps a CharSequence and overrides some functions to return a configurable mask string instead of the actual content. The main use case for this class is to prevent that sensitive information like passwords are visible in log output. The class can be used everywhere a CharSequence is accepted.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final CharSequence getValue() The wrapped string.
      final String getMask() A string that is returned by the toString method instead of the actual value.
      String toString()
      • Methods inherited from class kotlin.CharSequence

        chars, codePoints, get, getLength, isEmpty, subSequence
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait