title: Adding a dynamic json property as java pojo for jackson
body: <p>I need to create a Json payload like this from Java pojo : </p>
  
  <pre><code>{ "update" : {
      "labels" : [{"add" : "A label"} ]
      }
   }
  </code></pre>
  
  <p>so I created a Java pojo like this : </p>
  
  <pre><code>@JsonRootName(value = "update")
  public class AddLabel{
    @JsonProperty("labels")
    public List&lt;Label&gt; labels; 
    public AddLabel(String labelName){
       this.labels = new ArrayList&lt;&gt;(); 
       this.labels.add(new Label(labelName); 
    }
    public static class Label{
      public String add; 
      public Label(String labelName){
         this.add = labelName; 
      }
    }
  }
  </code></pre>
  
  <p>I like to have the "add" property in Label class as dynamic, so that it can also take values such as "remove", "set" . Is there a way to do this other than creating another POJO's for each of them? </p>