Skip to main content



      Home
Home » Archived » Sapphire » Equals and HashCode in ModelElements
Equals and HashCode in ModelElements [message #839921] Mon, 09 April 2012 08:18 Go to next message
Eclipse UserFriend
Hi,

I was having a look at the generated model classes and found out
that equals and hashCode aren't implemented.

My problem is:
I have a list of Nodes which have all a attribute id.
To validate the nodes I want to check if every id attribute
is unique. The code I imagine should look like this

INode node1 = ...
INode node2 = ...

node1.equals(node2) == node1.getId().getContent().equals(node2.getid().getContent());



cheers,
Muki
Re: Equals and HashCode in ModelElements [message #840068 is a reply to message #839921] Mon, 09 April 2012 12:20 Go to previous messageGo to next message
Eclipse UserFriend
In the upcoming 0.5 release, there is an EqualityService feature that gives model author ability to implement equals() and hashCode() methods. See the enhancements guide for the 0.5 release for more details.

- Konstantin
Re: Equals and HashCode in ModelElements [message #840069 is a reply to message #840068] Mon, 09 April 2012 12:20 Go to previous message
Eclipse UserFriend
No Message Body
Previous Topic:overriding @Required in subclass
Next Topic:Sapphire.Edit
Goto Forum:
  


Current Time: Wed Jul 23 13:34:29 EDT 2025

Powered by FUDForum. Page generated in 0.04706 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top