Migrate @AutoValue classes to Kotlin data classes

Proprietary

Replaces a Java or Kotlin @AutoValue abstract class with a Kotlin data class and rewrites its Kotlin and Java callers: x() accessors become x property reads (getX() in Java) and the static or companion create(..) factory becomes the constructor. A Java class becomes a .kt file in place of the .java file. Only classes consisting of abstract accessors and a single forwarding factory are converted; every @AutoValue class is listed in the AutoValueClasses data table with the reason it was skipped.

org.openrewrite.kotlin.migrate.autovalue.AutoValueToDataClass

Optional

keepJavaAccessorsBoolean

Give each property a @get:JvmName matching the AutoValue accessor, so Java call sites such as foo.bar() keep compiling unchanged instead of being rewritten to foo.getBar(). Factories still become constructors. Default false.

mod run . --recipe=org.openrewrite.kotlin.migrate.autovalue.AutoValueToDataClass

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.