Package cpw.mods.modlauncher.api
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 targettedelementName- 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 typeselementDescriptor- The method's descriptor. Empty string for other typestargetType- TheTargetTypefor 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 Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for theclassNamerecord component.private final StringThe field for theelementDescriptorrecord component.private final StringThe field for theelementNamerecord component.private final TargetType<T> The field for thetargetTyperecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theclassNamerecord component.Returns the value of theelementDescriptorrecord component.Returns the value of theelementNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static ITransformer.Target<org.objectweb.asm.tree.ClassNode> targetClass(String className) Convenience method returning aITransformer.Targetfor a classstatic ITransformer.Target<org.objectweb.asm.tree.FieldNode> targetField(String className, String fieldName) Convenience method returning aITransformer.Targetfor a fieldstatic ITransformer.Target<org.objectweb.asm.tree.MethodNode> targetMethod(String className, String methodName, String methodDescriptor) Convenience method return aITransformer.Targetfor a methodstatic ITransformer.Target<org.objectweb.asm.tree.ClassNode> targetPreClass(String className) Convenience method returning aITransformer.Targetfor a class (prior to other loading operations)Returns the value of thetargetTyperecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
className
The field for theclassNamerecord component. -
elementName
The field for theelementNamerecord component. -
elementDescriptor
The field for theelementDescriptorrecord component. -
targetType
The field for thetargetTyperecord component.
-
-
Constructor Details
-
Target
public Target(String className, String elementName, String elementDescriptor, TargetType<T> targetType) Creates an instance of aTargetrecord class.- Parameters:
className- the value for theclassNamerecord componentelementName- the value for theelementNamerecord componentelementDescriptor- the value for theelementDescriptorrecord componenttargetType- the value for thetargetTyperecord component
-
-
Method Details
-
targetClass
Convenience method returning aITransformer.Targetfor 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 aITransformer.Targetfor 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 aITransformer.Targetfor a method- Parameters:
className- The name of the class containing the methodmethodName- The name of the methodmethodDescriptor- 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 aITransformer.Targetfor a field- Parameters:
className- The name of the class containing the fieldfieldName- The name of the field- Returns:
- A target for the named field
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
className
Returns the value of theclassNamerecord component.- Returns:
- the value of the
classNamerecord component
-
elementName
Returns the value of theelementNamerecord component.- Returns:
- the value of the
elementNamerecord component
-
elementDescriptor
Returns the value of theelementDescriptorrecord component.- Returns:
- the value of the
elementDescriptorrecord component
-
targetType
Returns the value of thetargetTyperecord component.- Returns:
- the value of the
targetTyperecord component
-