title: Transforming attributes when using Immutables java
body: <p>I want to perform certain transformation on attributes of the class</p>
  <pre><code>    @Value.Immutable
  @JsonSerialize(as = ImmutableOrganizationEntity.class)
  @JsonDeserialize(as = ImmutableOrganizationEntity.class)
  public abstract class OrganizationEntity {
      @Length(min = 3, max = 256, message = &quot;Organization name max length is 256 and min length is 3&quot;)
      @NotNull(message = &quot;Organization name should not be empty&quot;)
      public abstract String getName();
  }
  </code></pre>
  <p>additionally I want to be able to sanitize the organization name for certain characters like presence of characters like '@' and replace them with '-' .Is there any construct that can let me do this . My end goal is when I receive the payload in controller</p>
  <pre><code>@RestController
  @RequestMapping(path = &quot;/api&quot;)
  public class Organization {
      @PostMapping(path = &quot;create&quot;)
      public ResponseEntity&lt;OrganizationEntity&gt; create(@Valid @RequestBody OrganizationEntity organization) {
          return new ResponseEntity(organization, HttpStatus.OK);
      }
  }
  </code></pre>
  <p>I want to have the correct values. I realized there are alternative ways to resolve to issue like</p>
  <ol>
  <li>In controller I can sanitize and create a new Organization entity.</li>
  <li>Use http interceptors to parse incoming request
  I want the avoid the above options and look for something in immutables during instantiation.</li>
  </ol>