Record Class DirectParameterRewrite
java.lang.Object
java.lang.Record
io.papermc.asm.rules.method.params.DirectParameterRewrite
- Record Components:
owners- the owners to targetexistingType- the type to convert tomethodMatcher- the method matcher to use which targets the legacy param typestaticHandler- the method which will be used to convert the legacy type to the new type
- All Implemented Interfaces:
GeneratedMethodHolder,GeneratedMethodSource<Set<Integer>>,StaticHandlerGeneratedMethodHolder,StaticHandlerGeneratedMethodHolder.Param,GeneratedStaticRewrite,TargetedTypeGeneratedStaticRewrite,TargetedTypeGeneratedStaticRewrite.Parameter,MethodRewriteRule,OwnableMethodRewriteRule,OwnableMethodRewriteRule.Filtered,StaticRewrite,OwnableRewriteRule,RewriteRule
public record DirectParameterRewrite(Set<ClassDesc> owners, ClassDesc existingType, TargetedMethodMatcher methodMatcher, Method staticHandler)
extends Record
implements TargetedTypeGeneratedStaticRewrite.Parameter, OwnableMethodRewriteRule.Filtered
Rewrites matching bytecode to a generated method which will invoke the static handler on all parameters that need to be converted. That
generated method then calls the original method with the new parameters.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.papermc.asm.rules.generate.GeneratedMethodHolder
GeneratedMethodHolder.CallData, GeneratedMethodHolder.ConstructorCallData, GeneratedMethodHolder.MethodCallDataNested classes/interfaces inherited from interface io.papermc.asm.rules.generate.GeneratedMethodSource
GeneratedMethodSource.NoContextNested classes/interfaces inherited from interface io.papermc.asm.rules.method.OwnableMethodRewriteRule
OwnableMethodRewriteRule.FilteredNested classes/interfaces inherited from interface io.papermc.asm.rules.RewriteRule
RewriteRule.Chain, RewriteRule.ChainBuilder, RewriteRule.Delegate, RewriteRule.GeneratorAdapterFactoryNested classes/interfaces inherited from interface io.papermc.asm.rules.generate.StaticHandlerGeneratedMethodHolder
StaticHandlerGeneratedMethodHolder.Param, StaticHandlerGeneratedMethodHolder.ReturnNested classes/interfaces inherited from interface io.papermc.asm.rules.method.generated.TargetedTypeGeneratedStaticRewrite
TargetedTypeGeneratedStaticRewrite.Parameter, TargetedTypeGeneratedStaticRewrite.Return -
Field Summary
Fields inherited from interface io.papermc.asm.rules.method.MethodRewriteRule
LAMBDA_METAFACTORY_OWNERFields inherited from interface io.papermc.asm.rules.RewriteRule
EMPTYFields inherited from interface io.papermc.asm.rules.method.StaticRewrite
CONSTRUCTOR_METHOD_NAME -
Constructor Summary
ConstructorsConstructorDescriptionDirectParameterRewrite(Set<ClassDesc> owners, ClassDesc existingType, TargetedMethodMatcher methodMatcher, Method staticHandler) Creates an instance of aDirectParameterRewriterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theexistingTyperecord component.final inthashCode()Returns a hash code value for this object.Returns the value of themethodMatcherrecord component.owners()Returns the value of theownersrecord component.Returns the value of thestaticHandlerrecord component.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.generate.GeneratedMethodHolder
createAdapterMethods inherited from interface io.papermc.asm.rules.generate.GeneratedMethodSource
generateConstructor, generateMethod, generateReturnValueMethods inherited from interface io.papermc.asm.rules.method.generated.GeneratedStaticRewrite
createConstructorRewrite, createRewrite, staticRedirectOwnerMethods inherited from interface io.papermc.asm.rules.method.MethodRewriteRule
createVisitorMethods inherited from interface io.papermc.asm.rules.method.OwnableMethodRewriteRule.Filtered
shouldProcessMethods inherited from interface io.papermc.asm.rules.OwnableRewriteRule
matchesOwnerMethods inherited from interface io.papermc.asm.rules.generate.StaticHandlerGeneratedMethodHolder.Param
createNewContext, generateParametersMethods inherited from interface io.papermc.asm.rules.method.StaticRewrite
rewrite, transformToRedirectDescriptorMethods inherited from interface io.papermc.asm.rules.method.generated.TargetedTypeGeneratedStaticRewrite.Parameter
transformInvokedDescriptor
-
Constructor Details
-
DirectParameterRewrite
public DirectParameterRewrite(Set<ClassDesc> owners, ClassDesc existingType, TargetedMethodMatcher methodMatcher, Method staticHandler) Creates an instance of aDirectParameterRewriterecord class.- Parameters:
owners- the value for theownersrecord componentexistingType- the value for theexistingTyperecord componentmethodMatcher- the value for themethodMatcherrecord componentstaticHandler- the value for thestaticHandlerrecord component
-
-
Method Details
-
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
-
existingType
Returns the value of theexistingTyperecord component.- Specified by:
existingTypein interfaceTargetedTypeGeneratedStaticRewrite- Returns:
- the value of the
existingTyperecord component
-
methodMatcher
Returns the value of themethodMatcherrecord component.- Specified by:
methodMatcherin interfaceOwnableMethodRewriteRule.Filtered- Specified by:
methodMatcherin interfaceTargetedTypeGeneratedStaticRewrite.Parameter- Returns:
- the value of the
methodMatcherrecord component
-
staticHandler
Returns the value of thestaticHandlerrecord component.- Specified by:
staticHandlerin interfaceStaticHandlerGeneratedMethodHolder- Returns:
- the value of the
staticHandlerrecord component
-