Is it possible to access copy function of data class in Java with optional parameters? e.g I want to change a3 in Java. What is the best way to do it considering my class A is immutable.
Should I write setter method which internally should do a copy by updating the required value or is there any other option?