I need to have a property on my DTO like idEncrypted because they can pass me only encrypted, however, I need to map the decrypt id as I find on DB. I already have a decrypt method, but I don't know how to map it and ignore the idEncrypted.
@Data
@EqualsAndHashCode(callSuper=false)
@NoArgsConstructor
public class MyDTO {
private String idEncrypted;
...
...
}
I don't know where to do the conversion
private Long idDecrypted = Long.parseLong(MyUtils.decrypt(idEncrypted));