Class ByteBuddyPatch.Builder

java.lang.Object
me.tamkungz.nilkit.tooling.bytebuddy.ByteBuddyPatch.Builder
Enclosing class:
ByteBuddyPatch

public static final class ByteBuddyPatch.Builder extends Object
  • Method Details

    • priority

      public ByteBuddyPatch.Builder priority(int priority)
      Lower values run first. This mirrors the useful part of Mixin priority while keeping ordering deterministic across different mods/patches.
    • require

      public ByteBuddyPatch.Builder require(net.bytebuddy.matcher.ElementMatcher<? super net.bytebuddy.description.method.MethodDescription> matcher)
      Requires exactly one declared method/constructor to match.
    • require

      public ByteBuddyPatch.Builder require(net.bytebuddy.matcher.ElementMatcher<? super net.bytebuddy.description.method.MethodDescription> matcher, int minimum, int maximum)
      Mixin-like require/expect guard. Transformation fails immediately when the target shape is outside the requested range.
    • advice

      public ByteBuddyPatch.Builder advice(net.bytebuddy.matcher.ElementMatcher<? super net.bytebuddy.description.method.MethodDescription> methodMatcher, Class<?> adviceClass)
      Applies Byte Buddy Advice to matched methods/constructors.

      Advice is the preferred Mixin-style HEAD/RETURN mechanism. It can modify arguments on enter, skip an original method, alter return values, inspect/replace thrown exceptions, and works for constructors where normal MethodDelegation is not appropriate.

    • intercept

      public ByteBuddyPatch.Builder intercept(net.bytebuddy.matcher.ElementMatcher<? super net.bytebuddy.description.method.MethodDescription> methodMatcher, net.bytebuddy.implementation.Implementation implementation)
      Replaces method implementations using any Byte Buddy Implementation, e.g. MethodDelegation, FixedValue, SuperMethodCall, or MethodCall.
    • mutate

      Adds a completely custom transformation. This is the escape hatch for MemberSubstitution, custom ASM visitors, field definitions, interfaces, method definitions and any Byte Buddy feature not wrapped here.
    • build

      public ByteBuddyPatch build()