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
- TheTargetType
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final String
The field for theclassName
record component.private final String
The field for theelementDescriptor
record component.private final String
The field for theelementName
record component.private final TargetType
<T> The field for thetargetType
record component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theclassName
record component.Returns the value of theelementDescriptor
record component.Returns the value of theelementName
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static ITransformer.Target
<org.objectweb.asm.tree.ClassNode> targetClass
(String className) Convenience method returning aITransformer.Target
for a classstatic ITransformer.Target
<org.objectweb.asm.tree.FieldNode> targetField
(String className, String fieldName) Convenience method returning aITransformer.Target
for a fieldstatic ITransformer.Target
<org.objectweb.asm.tree.MethodNode> targetMethod
(String className, String methodName, String methodDescriptor) Convenience method return aITransformer.Target
for a methodstatic ITransformer.Target
<org.objectweb.asm.tree.ClassNode> targetPreClass
(String className) Convenience method returning aITransformer.Target
for a class (prior to other loading operations)Returns the value of thetargetType
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
className
The field for theclassName
record component. -
elementName
The field for theelementName
record component. -
elementDescriptor
The field for theelementDescriptor
record component. -
targetType
The field for thetargetType
record component.
-
-
Constructor Details
-
Target
public Target(String className, String elementName, String elementDescriptor, TargetType<T> targetType) Creates an instance of aTarget
record class.- Parameters:
className
- the value for theclassName
record componentelementName
- the value for theelementName
record componentelementDescriptor
- the value for theelementDescriptor
record componenttargetType
- the value for thetargetType
record component
-
-
Method Details
-
targetClass
Convenience method returning aITransformer.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 aITransformer.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 aITransformer.Target
for 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.Target
for 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 theclassName
record component.- Returns:
- the value of the
className
record component
-
elementName
Returns the value of theelementName
record component.- Returns:
- the value of the
elementName
record component
-
elementDescriptor
Returns the value of theelementDescriptor
record component.- Returns:
- the value of the
elementDescriptor
record component
-
targetType
Returns the value of thetargetType
record component.- Returns:
- the value of the
targetType
record component
-