If I want to modify one single parameter in a constructor.
In the Scala case class, the apply method will be overridden twice. Unless apply applies ( no pun ) to auxiliary constructor. Related to
How one can modify one single input from a constructor ?
Criteria :
The class must hold immutable data. All data must be accessible.
Note it doesn't have to be case class.
Additionally , no need to use the apply method.
no extra unused parameters. In the example below,
_fistNameis still accessible but unused.
case class Person( lastName: String, _fistName: String, ... ) { lazy val fistName = _fistName.toLowerCase }