How to compare all attributes between classes except a few?

有些话、适合烂在心里 提交于 2021-01-29 04:34:05

问题


I've got the answer on how to compare all attributes between two classes on this question, but my classes also have DateTime attributes that are defined on the fly, this way I cannot compare them because the DateTime on each class will have seconds of difference.

How can I compare two classes attributes excluding some attributes? In this example, excluding the attribute z.

case class Rect(x: Int, y: Int, z: Double)
case class Squa(x: Int, y: Int, z: Double)

来源:https://stackoverflow.com/questions/64593358/how-to-compare-all-attributes-between-classes-except-a-few

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!