@Test public void testThisValue() throws Exception { Class<? extends QuxBaz> quxbaz = new ByteBuddy() .subclass(QuxBaz.class) .method(isDeclaredBy(QuxBaz.class)) .intercept(FixedValue.self()) .make() .load(QuxBaz.class.getClassLoader(), ClassLoadingStrategy.Default.WRAPPER) .getLoaded(); assertThat(quxbaz.getDeclaredFields().length, is(0)); assertThat(quxbaz.getDeclaredMethods().length, is(1)); QuxBaz self = quxbaz.getDeclaredConstructor().newInstance(); assertThat(self.bar(), sameInstance((Object) self)); }
public static AssignerConfigurable self() { return new ForThisValue(); }
FixedValue implements Implementation { public static AssignerConfigurable self() { return new ForThisValue(); } }
FixedValue implements Implementation { public static AssignerConfigurable self() { return new ForThisValue(); } protected  FixedValue(Assigner assigner, Assigner.Typing typing); }
FixedValue implements Implementation { public static AssignerConfigurable self() { return new ForThisValue(); } protected  FixedValue(Assigner assigner, Assigner.Typing typing); static AssignerConfigurable value(Object fixedValue); static AssignerConfigurable reference(Object fixedValue); static AssignerConfigurable reference(Object fixedValue, String fieldName); static AssignerConfigurable value(TypeDescription fixedValue); static AssignerConfigurable value(JavaConstant fixedValue); static AssignerConfigurable argument(int index); static AssignerConfigurable self(); static Implementation nullValue(); static AssignerConfigurable originType(); }
FixedValue implements Implementation { public static AssignerConfigurable self() { return new ForThisValue(); } protected  FixedValue(Assigner assigner, Assigner.Typing typing); static AssignerConfigurable value(Object fixedValue); static AssignerConfigurable reference(Object fixedValue); static AssignerConfigurable reference(Object fixedValue, String fieldName); static AssignerConfigurable value(TypeDescription fixedValue); static AssignerConfigurable value(JavaConstant fixedValue); static AssignerConfigurable argument(int index); static AssignerConfigurable self(); static Implementation nullValue(); static AssignerConfigurable originType();  }