Skip to content

Serialize objects to String as kotlin source code. Make your test doubles without manually rewriting toString() output to kotlin code.

License

Notifications You must be signed in to change notification settings

OndrejMalek/toKotlin

Repository files navigation

Work in progress

toKotlin() like toString() but returns kotlin code as String

Example:

arrayOf(1,2,3).toKotlin() == "arrayOf(1, 2, 3)"
arrayOf<Int>().toKotlin() == "arrayOf<Int>()"

Purpose of this is to create test doubles easily. Uses generics reflection with reified. Is extension function. Meant as development tool.

Implemented

Arrays, Lists, Maps, Sets

TODO

  • Data classes
  • Functions
  • Lambdas ( probably not possible without parsing all codebase )

About

Serialize objects to String as kotlin source code. Make your test doubles without manually rewriting toString() output to kotlin code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages