Record Class AccessTransformerRule
java.lang.Object
java.lang.Record
com.hloader.at.AccessTransformerRule
- Record Components:
owner- dotted class name the rule targets, in named/deobfuscated formmember- the raw field or method name as it appears in the actual bytecode, ornull/"*"to change the class itselfdescriptor- the method's raw descriptor ifmemberis a method,nullfor a field or a whole-class rule
public record AccessTransformerRule(AccessTransformerRule.Visibility visibility, AccessTransformerRule.FinalChange finalChange, String owner, String member, String descriptor)
extends Record
One Forge-style access-transformer rule:
<access>[+f|-f] <owner> [<member> [<descriptor>]].
owner is given in named (deobfuscated) form and translated to the runtime obfuscated
class name via RuntimeClassMap when applied - see AccessTransformerApplier.
member/descriptor, however, are matched literally against the loaded
bytecode - i.e. they need to be the class's raw obfuscated field/method name and descriptor,
not a human-readable (MCP) one. This mirrors real Forge ATs, which have always referenced
members by their stable SRG name for the same reason: translating a member reference through a
mapping layer needs its descriptor translated too (every class name it mentions), which is a
meaningfully harder problem than translating a single class name and isn't implemented here.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Constructor Summary
ConstructorsConstructorDescriptionAccessTransformerRule(AccessTransformerRule.Visibility visibility, AccessTransformerRule.FinalChange finalChange, String owner, String member, String descriptor) Creates an instance of aAccessTransformerRulerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescriptorrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefinalChangerecord component.final inthashCode()Returns a hash code value for this object.member()Returns the value of thememberrecord component.owner()Returns the value of theownerrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevisibilityrecord component.
-
Constructor Details
-
AccessTransformerRule
public AccessTransformerRule(AccessTransformerRule.Visibility visibility, AccessTransformerRule.FinalChange finalChange, String owner, String member, String descriptor) Creates an instance of aAccessTransformerRulerecord class.- Parameters:
visibility- the value for thevisibilityrecord componentfinalChange- the value for thefinalChangerecord componentowner- the value for theownerrecord componentmember- the value for thememberrecord componentdescriptor- the value for thedescriptorrecord component
-
-
Method Details
-
toString
-
hashCode
-
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). -
visibility
Returns the value of thevisibilityrecord component.- Returns:
- the value of the
visibilityrecord component
-
finalChange
Returns the value of thefinalChangerecord component.- Returns:
- the value of the
finalChangerecord component
-
owner
-
member
-
descriptor
Returns the value of thedescriptorrecord component.- Returns:
- the value of the
descriptorrecord component
-