declare Person

  name : String

  ssn: BigDecimal

  age : int

end

 

 

Is there a way to define what field/s identify a Person?

 

In the example above I would like to define ssn as the unique indentifier for person, so person1 == person2 if person1.ssn == person2.ssn.

 

In this case equals would use only the field ssn to determine if 2 person objects are equal.

The hashcode should also be based only on the ssn field.

 

I want to use Person with assertBehaviour equality…

 

Thanks

 

--zoly