Record Class StaticRewrites.FuzzyParam

java.lang.Object
java.lang.Record
io.papermc.asm.rules.method.StaticRewrites.FuzzyParam
All Implemented Interfaces:
GeneratedMethodHolder, GeneratedMethodSource<Set<Integer>>, StaticRewriteGeneratedMethodHolder, StaticRewriteGeneratedMethodHolder.Param, MethodRewriteRule, OwnableMethodRewriteRule, OwnableMethodRewriteRule.Filtered, StaticRewrite, StaticRewrite.Generated, StaticRewrite.Generated.Param, OwnableRewriteRule, RewriteRule
Enclosing class:
StaticRewrites

public static record StaticRewrites.FuzzyParam(Set<ClassDesc> owners, ClassDesc existingType, TargetedMethodMatcher methodMatcher, Method staticHandler) extends Record implements StaticRewrite.Generated.Param
  • Constructor Details

    • FuzzyParam

      public FuzzyParam(Set<ClassDesc> owners, ClassDesc existingType, TargetedMethodMatcher methodMatcher, Method staticHandler)
      Creates an instance of a FuzzyParam record class.
      Parameters:
      owners - the value for the owners record component
      existingType - the value for the existingType record component
      methodMatcher - the value for the methodMatcher record component
      staticHandler - the value for the staticHandler record component
  • Method Details

    • transformToRedirectDescriptor

      public MethodTypeDesc transformToRedirectDescriptor(MethodTypeDesc intermediateDescriptor)
      Description copied from interface: StaticRewrite
      Transforms the intermediate descriptor to the final descriptor that will be used in the rewritten bytecode.

      Intermediate means that it has been modified from the original accounting for the virtual/interface/static/constructor-ness of the method call.

      Specified by:
      transformToRedirectDescriptor in interface StaticRewrite
      Parameters:
      intermediateDescriptor - the intermediate descriptor
      Returns:
      the final descriptor to be used in the rewritten bytecode
    • transformInvokedDescriptor

      public MethodTypeDesc transformInvokedDescriptor(MethodTypeDesc original, Set<Integer> context)
      Description copied from interface: GeneratedMethodSource
      Transforms the descriptor of the generated method to the descriptor of the method that will be called within the generated method. This should be the method that actually exists in source.
      Specified by:
      transformInvokedDescriptor in interface GeneratedMethodSource<Set<Integer>>
      Specified by:
      transformInvokedDescriptor in interface StaticRewrite.Generated.Param
      Parameters:
      original - the method descriptor of the generated method that the bytecode was redirected to
      context - context for the generator
      Returns:
      the descriptor of the method that will be called inside the generated method
    • createRewrite

      Description copied from interface: StaticRewrite
      Creates a rewrite for the given method call data.
      Specified by:
      createRewrite in interface StaticRewrite
      Specified by:
      createRewrite in interface StaticRewrite.Generated
      Parameters:
      context - the context
      intermediateDescriptor - the descriptor modified from the original to account for the method call type (interface, virtual, static, etc.)
      originalCallData - the original method call data
      Returns:
      the rewrite
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • owners

      public Set<ClassDesc> owners()
      Returns the value of the owners record component.
      Specified by:
      owners in interface OwnableRewriteRule
      Returns:
      the value of the owners record component
    • existingType

      public ClassDesc existingType()
      Returns the value of the existingType record component.
      Specified by:
      existingType in interface StaticRewrite.Generated
      Returns:
      the value of the existingType record component
    • methodMatcher

      public TargetedMethodMatcher methodMatcher()
      Returns the value of the methodMatcher record component.
      Specified by:
      methodMatcher in interface OwnableMethodRewriteRule.Filtered
      Specified by:
      methodMatcher in interface StaticRewrite.Generated
      Returns:
      the value of the methodMatcher record component
    • staticHandler

      public Method staticHandler()
      Returns the value of the staticHandler record component.
      Specified by:
      staticHandler in interface StaticRewriteGeneratedMethodHolder
      Returns:
      the value of the staticHandler record component