@Test public void testNullValue() throws Exception { Class<? extends Foo> foo = new ByteBuddy() .subclass(Foo.class) .method(isDeclaredBy(Foo.class)) .intercept(FixedValue.nullValue()) .make() .load(Foo.class.getClassLoader(), ClassLoadingStrategy.Default.WRAPPER) .getLoaded(); assertThat(foo.getDeclaredFields().length, is(0)); assertThat(foo.getDeclaredMethods().length, is(1)); assertThat(foo.getDeclaredMethod(BAR).invoke(foo.getDeclaredConstructor().newInstance()), nullValue(Object.class)); }
public static Implementation nullValue() { return ForNullValue.INSTANCE; }
FixedValue implements Implementation { public static Implementation nullValue() { return ForNullValue.INSTANCE; } }
FixedValue implements Implementation { public static Implementation nullValue() { return ForNullValue.INSTANCE; } protected  FixedValue(Assigner assigner, Assigner.Typing typing); }
FixedValue implements Implementation { public static Implementation nullValue() { return ForNullValue.INSTANCE; } 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 Implementation nullValue() { return ForNullValue.INSTANCE; } 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();  }