A is case classextremely good for storing complex values, such as object objects. They are considered for this particular case, so they provide you with methods that make sense for this use case, synthesizing the methods you mentioned and, in addition, creating your class Serializableand creating a companion object using the "factory" method (other than an extractor for pattern matching).
The disadvantages are as follows:
, case class, : equals , ? , Serializable? , ?
: , ; , , case class?
case class case class, , . ? : . .