Package io.papermc.asm.rules.field
Record Class FieldRewrites.Rename
java.lang.Object
java.lang.Record
io.papermc.asm.rules.field.FieldRewrites.Rename
- All Implemented Interfaces:
FieldRewriteRule,FilteredFieldRewriteRule,OwnableRewriteRule,RewriteRule
- Enclosing class:
- FieldRewrites
public static record FieldRewrites.Rename(Set<Class<?>> owners, FieldMatcher fieldMatcher, String newName)
extends Record
implements FilteredFieldRewriteRule
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.papermc.asm.rules.field.FieldRewriteRule
FieldRewriteRule.Rewrite, FieldRewriteRule.RewriteField, FieldRewriteRule.RewriteToMethodNested classes/interfaces inherited from interface io.papermc.asm.rules.RewriteRule
RewriteRule.Chain, RewriteRule.ChainBuilder, RewriteRule.MethodGeneratorFactory -
Field Summary
Fields inherited from interface io.papermc.asm.rules.RewriteRule
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionRename(Set<Class<?>> owners, FieldMatcher fieldMatcher, String newName) Creates an instance of aRenamerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefieldMatcherrecord component.final inthashCode()Returns a hash code value for this object.newName()Returns the value of thenewNamerecord component.owners()Returns the value of theownersrecord component.rewrite(ClassProcessingContext context, int opcode, String owner, String name, ClassDesc desc) final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.papermc.asm.rules.field.FieldRewriteRule
createVisitorMethods inherited from interface io.papermc.asm.rules.field.FilteredFieldRewriteRule
shouldProcessMethods inherited from interface io.papermc.asm.rules.OwnableRewriteRule
matchesOwnerMethods inherited from interface io.papermc.asm.rules.RewriteRule
generateMethods
-
Constructor Details
-
Rename
Creates an instance of aRenamerecord class.- Parameters:
owners- the value for theownersrecord componentfieldMatcher- the value for thefieldMatcherrecord componentnewName- the value for thenewNamerecord component
-
-
Method Details
-
rewrite
public @Nullable FieldRewriteRule.Rewrite rewrite(ClassProcessingContext context, int opcode, String owner, String name, ClassDesc desc) - Specified by:
rewritein interfaceFieldRewriteRule
-
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). -
owners
Returns the value of theownersrecord component.- Specified by:
ownersin interfaceOwnableRewriteRule- Returns:
- the value of the
ownersrecord component
-
fieldMatcher
Returns the value of thefieldMatcherrecord component.- Specified by:
fieldMatcherin interfaceFilteredFieldRewriteRule- Returns:
- the value of the
fieldMatcherrecord component
-
newName
Returns the value of thenewNamerecord component.- Returns:
- the value of the
newNamerecord component
-