java.lang.Object
org.spongepowered.asm.obfuscation.mapping.common.MappingMethod
All Implemented Interfaces:
IMapping<MappingMethod>

public class MappingMethod extends Object implements IMapping<MappingMethod>
Stores information about a method mapping during AP runs
  • Constructor Details

    • MappingMethod

      public MappingMethod(String fullyQualifiedName, String desc)
    • MappingMethod

      public MappingMethod(String owner, String simpleName, String desc)
  • Method Details

    • getType

      public IMapping.Type getType()
      Description copied from interface: IMapping
      Get the mapping type (field, method, class, package)
      Specified by:
      getType in interface IMapping<MappingMethod>
    • getName

      public String getName()
      Description copied from interface: IMapping
      Get the mapping name, for method mappings this includes the owner
      Specified by:
      getName in interface IMapping<MappingMethod>
      Returns:
      the mapping name, includes the owner for method mappings
    • getSimpleName

      public String getSimpleName()
      Description copied from interface: IMapping
      Get the base name of this member, for example the bare field, method or class name
      Specified by:
      getSimpleName in interface IMapping<MappingMethod>
      Returns:
      the base name of this mapping
    • getOwner

      public String getOwner()
      Description copied from interface: IMapping
      Get the owner of this member, for fields and methods this is the class name, for classes it is the package name, for packages it is undefined. Can return null.
      Specified by:
      getOwner in interface IMapping<MappingMethod>
      Returns:
      the parent of this mapping
    • getDesc

      public String getDesc()
      Description copied from interface: IMapping
      Get the descriptor of this member, for example the method descriptor or field type. For classes and packages this is undefined. Can return null since not all mapping types support descriptors.
      Specified by:
      getDesc in interface IMapping<MappingMethod>
      Returns:
      the mapping descriptor
    • getSuper

      public MappingMethod getSuper()
      Description copied from interface: IMapping
      Get the next most immediate super-implementation of this mapping. For example if the mapping is a method and the method overrides a method in the immediate superclass, return that method. Can return null if no superclass is available or if no superclass definition exists.
      Specified by:
      getSuper in interface IMapping<MappingMethod>
      Returns:
      the method immediately overridden by this method, or null if not present or not resolvable
    • isConstructor

      public boolean isConstructor()
    • move

      public MappingMethod move(String newOwner)
      Description copied from interface: IMapping
      Create a clone of this mapping with a new owner
      Specified by:
      move in interface IMapping<MappingMethod>
      Parameters:
      newOwner - new owner
      Returns:
      cloned mapping
    • remap

      public MappingMethod remap(String newName)
      Description copied from interface: IMapping
      Create a clone of this mapping with a new name
      Specified by:
      remap in interface IMapping<MappingMethod>
      Parameters:
      newName - new name
      Returns:
      cloned mapping
    • transform

      public MappingMethod transform(String newDesc)
      Description copied from interface: IMapping
      Create a clone of this mapping with a new descriptor
      Specified by:
      transform in interface IMapping<MappingMethod>
      Parameters:
      newDesc - new descriptor
      Returns:
      cloned mapping
    • copy

      public MappingMethod copy()
      Description copied from interface: IMapping
      Create a clone of this mapping
      Specified by:
      copy in interface IMapping<MappingMethod>
      Returns:
      cloned mapping
    • addPrefix

      public MappingMethod addPrefix(String prefix)
      Return a clone of this mapping with the supplied prefix added. Returns this object if the prefix matches the existing name.
      Parameters:
      prefix - prefix to prepend
      Returns:
      cloned mapping
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • serialise

      public String serialise()
      Description copied from interface: IMapping
      Get a representation of this mapping for serialisation. Individual writers are free to use their own mappings, this method is for convenience only.
      Specified by:
      serialise in interface IMapping<MappingMethod>
      Returns:
      string representation of this mapping
    • toString

      public String toString()
      Overrides:
      toString in class Object