title: Create custom code in a constructor created with ByteBuddy
body: <p>I'm new with byteBudd and doing first test to learn about it I got a solution for a "problem" but I would like to improve it.
  I would like to generate a this code:</p>
  
  <pre><code>public class A {
    private String value;
    public A(){}
    public A(Map&lt;String, Object&gt; p){
      this.value=p.get("value");
    }
    //getter and setter
  }
  </code></pre>
  
  <p>I made it work using MethodDelegation.to and use of reflection with this code</p>
  
  <pre><code>@Test
      public void withReflection() throws Exception {
  
  
          DynamicType.Builder builder = new ByteBuddy()
                  .subclass(Object.class, ConstructorStrategy.Default.NO_CONSTRUCTORS)
                  .name("cat.altimiras.dynamic.AAA") //must be same package
                  .defineField("value", String.class, Visibility.PRIVATE)
                  .defineMethod("getValue", String.class, Visibility.PUBLIC)
                  .intercept(FieldAccessor.ofBeanProperty())
                  .defineMethod("setValue", void.class, Visibility.PUBLIC)
                  .withParameters(String.class)
                  .intercept(FieldAccessor.ofBeanProperty())
                  .defineConstructor(Visibility.PUBLIC)
                  .intercept(MethodCall.invoke(Object.class.getDeclaredConstructor()))
                  .defineConstructor(Visibility.PUBLIC)
                  .withParameter(Map.class)
                  .intercept(
                          MethodCall.invoke(Object.class.getDeclaredConstructor())
                                  .andThen(
                                      MethodDelegation.to(
                                              new Object() {
                                                  public void assign(@RuntimeType Map&lt;String, Object&gt; value, @This Object o) throws Exception {
                                                      Field f = o.getClass().getDeclaredField("value");
                                                      f.setAccessible(true);
                                                      f.set(o, value.get("value")); // Reflection
                                                  }
                                              }
                                      )
                                  )
                  );
  
          Class cl = builder.make().load(this.getClass().getClassLoader(), ClassLoadingStrategy.Default.INJECTION).getLoaded();
  
          Map&lt;String, String&gt; p = new HashMap&lt;&gt;();
          p.put("value", "lala");
  
          Object o = cl.getConstructor(Map.class).newInstance(p);
  
          Assert.assertEquals("lala", o.getClass().getDeclaredMethod("getValue").invoke(o));
  </code></pre>
  
  <p>This is working but I don't like because :
  1 - I would like to avoid the use of reflection 
  2 - "A" can't not be to a random package "x.y.z.A" for instance</p>
  
  <p>Do you know if this is possible? And how to do it?</p>
  
  <p>Thanks in advance</p>