java.lang.Object
org.spongepowered.asm.obfuscation.mapping.common.MappingField
All Implemented Interfaces:
IMapping<MappingField>
Direct Known Subclasses:
MappingFieldSrg

public class MappingField
extends java.lang.Object
implements IMapping<MappingField>
Stores information about a field mapping during AP runs
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.spongepowered.asm.obfuscation.mapping.IMapping

    IMapping.Type
  • Constructor Summary

    Constructors
    Constructor Description
    MappingField​(java.lang.String owner, java.lang.String name)  
    MappingField​(java.lang.String owner, java.lang.String name, java.lang.String desc)  
  • Method Summary

    Modifier and Type Method Description
    MappingField copy()
    Create a clone of this mapping
    boolean equals​(java.lang.Object obj)  
    java.lang.String getDesc()
    Get the descriptor of this member, for example the method descriptor or field type.
    java.lang.String getName()
    Get the mapping name, for method mappings this includes the owner
    java.lang.String getOwner()
    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.
    java.lang.String getSimpleName()
    Get the base name of this member, for example the bare field, method or class name
    MappingField getSuper()
    Get the next most immediate super-implementation of this mapping.
    IMapping.Type getType()
    Get the mapping type (field, method, class, package)
    int hashCode()  
    MappingField move​(java.lang.String newOwner)
    Create a clone of this mapping with a new owner
    MappingField remap​(java.lang.String newName)
    Create a clone of this mapping with a new name
    java.lang.String serialise()
    Get a representation of this mapping for serialisation.
    java.lang.String toString()  
    MappingField transform​(java.lang.String newDesc)
    Create a clone of this mapping with a new descriptor

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MappingField

      public MappingField​(java.lang.String owner, java.lang.String name)
    • MappingField

      public MappingField​(java.lang.String owner, java.lang.String name, java.lang.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<MappingField>
    • getName

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

      public final java.lang.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<MappingField>
      Returns:
      the base name of this mapping
    • getOwner

      public final java.lang.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<MappingField>
      Returns:
      the parent of this mapping
    • getDesc

      public final java.lang.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<MappingField>
      Returns:
      the mapping descriptor
    • getSuper

      public MappingField 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<MappingField>
      Returns:
      the method immediately overridden by this method, or null if not present or not resolvable
    • move

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

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

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

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

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

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • serialise

      public java.lang.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<MappingField>
      Returns:
      string representation of this mapping
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object