title: How to convert json to Object in mule 4
body: <p>My json looks like this :</p>
  
  <p>{
  "key1" : "aa",
  "key2" : "bb"
  }</p>
  
  <p>and java class looks like this :</p>
  
  <p>public class Example {</p>
  
  <pre><code>@NotBlank
  @Size(min = 3, max = 5)
  private String key1;
  
  @Pattern(regexp=".+@.+\\.[a-z]+") // email
  private String key2;
  </code></pre>
  
  <p>}</p>
  
  <p>I used transform connector to convert my payload to json :</p>
  
  <pre><code>%dw 2.0
  output application/java
  ---
  payload as Object {class: "Entities/Example"}
  </code></pre>
  
  <p>I get this error : </p>
  
  <pre><code>"Unable to find class 'Entities/Example'
  
  4| payload as Object {class: "Entities/Example"}
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  Trace:
    at main (line: 4, column: 1), while writing Java at 
  4| payload as Object {class: "Entities/Example"}
  </code></pre>
  
  <p>My package structure looks like this :
  <a href="https://i.stack.imgur.com/MS8Qi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MS8Qi.png" alt="enter image description here"></a></p>