Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (16 sloc) 823 Bytes
Keys for Equality and Hashing
<p>In any class you can specify a set of attributes and associations as
keys. The associations must have a multiplicity of 1 at the other end.
This allows Umple to generate code that defines what objects of the
class are equal (they have the same values for the key).</p>
<p>Umple will also generate a hashCode method in any class that has a defined key. This helps
when looking up an object in a set.</p>
<p>Place the comma-separated list of key elements in curly brackets, after the word key. <a href="W007KeyAlreadySpecified.html">If you have multiple key statements, a warning is generated.</a></p>
[[keyDefinition]] [[defaultKey]] [[key]] [[softwarePattern]]
@@source manualexamples/KeysforEqualityandHashing1.ump
You can’t perform that action at this time.