Package 

Object Taintable.Companion

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String stringify(String s) Surrounds strings with double quotes and escapes any internal double-quotes.
      final String stringify(Taintable ts) Surrounds Taintables with double quotes and escapes any internal double-quotes, line-feeds, or dollar-signs.
      final String charToStr(Character c) Surround chars with single quotes and escape any internal single- or double-quotes
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • stringify

         final String stringify(String s)

        Surrounds strings with double quotes and escapes any internal double-quotes. This was written for debugging, but using a project like Indented lets you create object graph representations that actually compile to those objects (they can be homoiconic). You can copy homoiconic representations from your debugging output and paste them directly into unit tests. Code-as-data (and data-as-code) is handy. Just sayin'.

        This is also an example of how to escape output for a specific purpose. In this case, Kotlin and Java Strings. You may wish to make your own encoding methods for other output types: htmlify, csvify, etc. or even wrapper types for encoded data, or to wrap writers...

      • charToStr

         final String charToStr(Character c)

        Surround chars with single quotes and escape any internal single- or double-quotes