Package com.tonic.renamer.mapping
Class MethodMapping
- java.lang.Object
-
- com.tonic.renamer.mapping.MethodMapping
-
- All Implemented Interfaces:
RenameMapping
public final class MethodMapping extends Object implements RenameMapping
Represents a method rename mapping.
-
-
Constructor Summary
Constructors Constructor Description MethodMapping(String owner, String oldName, String descriptor, String newName)Creates a new method mapping without hierarchy propagation.MethodMapping(String owner, String oldName, String descriptor, String newName, boolean propagate)Creates a new method mapping with hierarchy propagation option.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetDescriptor()StringgetFullyQualifiedName()Joins the owner, original name and descriptor into one identifier.StringgetNewName()StringgetOldName()StringgetOwner()inthashCode()booleanisPropagate()StringtoString()
-
-
-
Constructor Detail
-
MethodMapping
public MethodMapping(String owner, String oldName, String descriptor, String newName, boolean propagate)
Creates a new method mapping with hierarchy propagation option.- Parameters:
owner- The internal name of the class owning the method (e.g., "com/example/MyClass")oldName- The old method name (e.g., "process")descriptor- The method descriptor (e.g., "(ILjava/lang/String;)V")newName- The new method name (e.g., "handle")propagate- Whether to propagate the rename through the inheritance hierarchy
-
MethodMapping
public MethodMapping(String owner, String oldName, String descriptor, String newName)
Creates a new method mapping without hierarchy propagation.- Parameters:
owner- The internal name of the class owning the method (e.g., "com/example/MyClass")oldName- The old method name (e.g., "process")descriptor- The method descriptor (e.g., "(ILjava/lang/String;)V")newName- The new method name (e.g., "handle")- Throws:
IllegalArgumentException- if any argument is null or empty, if the names are equal, or if the old name is a constructor or static initializer
-
-
Method Detail
-
getOwner
public String getOwner()
- Returns:
- the owner
-
getDescriptor
public String getDescriptor()
- Returns:
- the descriptor
-
isPropagate
public boolean isPropagate()
- Returns:
- whether propagate
-
getOldName
public String getOldName()
- Specified by:
getOldNamein interfaceRenameMapping- Returns:
- the old (original) name being renamed
-
getNewName
public String getNewName()
- Specified by:
getNewNamein interfaceRenameMapping- Returns:
- the new name to rename to
-
getFullyQualifiedName
public String getFullyQualifiedName()
Joins the owner, original name and descriptor into one identifier.- Returns:
- the identifier, formatted as "owner.oldName:descriptor"
-
-