title: Object Mapper mapping for a particular class during http calls
body: <p>Is there a way where we can add ObjectMapper for a particular class through annotation.</p>
  
  <pre><code>@JsonRootName("employee")
  public class Sample implements Serializable{
      private String name;
      private String id;
      // Getters and setters 
  }
  </code></pre>
  
  <p>In the RestController i have RequestMapping and a method like:-</p>
  
  <pre><code> @ResponseBody
   public Sample (@RequestBody Sample sample){
   //some logic
   return sample;
  }
  </code></pre>
  
  <p>My input payload to this will be like </p>
  
  <pre><code>    {
        "employee":{
              "name":"abcd",
              "id":"1234"
          }
      }
  </code></pre>
  
  <p>My desired output would be </p>
  
  <pre><code>{
      "name":"abcd",
      "id":"1234"
  }
  </code></pre>
  
  <p>1)Is there a way i can use the same class to fulfill the input and the output.</p>
  
  <p>2) I have added @JsonRootName at the top of the class which requires ObjectMapper's Serialization feature enable to WRAP_ROOT_VALUE like :-</p>
  
  <pre><code>ObjectMapper mapper = new ObjectMapper();
  mapper.enable(SerializationFeature.WRAP_ROOT_VALUE);
  mapper.enable(DeserializationFeature.UNWRAP_ROOT_VALUE); 
  </code></pre>
  
  <p>where this can be added to reflect in only this class.</p>