Change type

Apache 2.0

Change a given type to another.

org.openrewrite.java.ChangeType

Required

Fully-qualified class name of the original type.

Fully-qualified class name of the replacement type, or the name of a primitive such as "int". The OuterClassName$NestedClassName naming convention should be used for nested classes.

Optional

ignoreDefinitionBoolean

When set to true the definition of the old type will be left untouched. This is useful when you're replacing usage of a class but don't want to rename it.

mod run . --recipe=org.openrewrite.java.ChangeType \ -P oldFullyQualifiedTypeName=org.junit.Assume \ -P newFullyQualifiedTypeName=org.junit.jupiter.api.Assumptions

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