Record Class ITransformer.Target<T>

java.lang.Object
java.lang.Record
cpw.mods.modlauncher.api.ITransformer.Target<T>
Record Components:
className - The name of the class being targetted
elementName - The name of the element being targetted. This is the field name for a field, the method name for a method. Empty string for other types
elementDescriptor - The method's descriptor. Empty string for other types
targetType - The TargetType for this target - it should match the ITransformer type variable T
Enclosing interface:
ITransformer<T>

public static record ITransformer.Target<T>(String className, String elementName, String elementDescriptor, TargetType<T> targetType) extends Record
Simple data holder indicating where the ITransformer can target.
  • Field Details

    • className

      private final String className
      The field for the className record component.
    • elementName

      private final String elementName
      The field for the elementName record component.
    • elementDescriptor

      private final String elementDescriptor
      The field for the elementDescriptor record component.
    • targetType

      private final TargetType<T> targetType
      The field for the targetType record component.
  • Constructor Details

    • Target

      public Target(String className, String elementName, String elementDescriptor, TargetType<T> targetType)
      Creates an instance of a Target record class.
      Parameters:
      className - the value for the className record component
      elementName - the value for the elementName record component
      elementDescriptor - the value for the elementDescriptor record component
      targetType - the value for the targetType record component
  • Method Details

    • targetClass

      public static ITransformer.Target<org.objectweb.asm.tree.ClassNode> targetClass(String className)
      Convenience method returning a ITransformer.Target for a class
      Parameters:
      className - The name of the class
      Returns:
      A target for the named class
    • targetPreClass

      public static ITransformer.Target<org.objectweb.asm.tree.ClassNode> targetPreClass(String className)
      Convenience method returning a ITransformer.Target for a class (prior to other loading operations)
      Parameters:
      className - The name of the class
      Returns:
      A target for the named class
    • targetMethod

      public static ITransformer.Target<org.objectweb.asm.tree.MethodNode> targetMethod(String className, String methodName, String methodDescriptor)
      Convenience method return a ITransformer.Target for a method
      Parameters:
      className - The name of the class containing the method
      methodName - The name of the method
      methodDescriptor - The method's descriptor string
      Returns:
      A target for the named method
    • targetField

      public static ITransformer.Target<org.objectweb.asm.tree.FieldNode> targetField(String className, String fieldName)
      Convenience method returning a ITransformer.Target for a field
      Parameters:
      className - The name of the class containing the field
      fieldName - The name of the field
      Returns:
      A target for the named field
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • className

      public String className()
      Returns the value of the className record component.
      Returns:
      the value of the className record component
    • elementName

      public String elementName()
      Returns the value of the elementName record component.
      Returns:
      the value of the elementName record component
    • elementDescriptor

      public String elementDescriptor()
      Returns the value of the elementDescriptor record component.
      Returns:
      the value of the elementDescriptor record component
    • targetType

      public TargetType<T> targetType()
      Returns the value of the targetType record component.
      Returns:
      the value of the targetType record component