Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Equals and HashCode in ModelElements
Equals and HashCode in ModelElements [message #839921] Mon, 09 April 2012 08:18 Go to next message
Nepomuk Seiler is currently offline Nepomuk Seiler
Messages: 88
Registered: December 2010
Member
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
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 923
Registered: July 2009
Senior Member
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
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 923
Registered: July 2009
Senior Member
No Message Body
Previous Topic:overriding @Required in subclass
Next Topic:Sapphire.Edit
Goto Forum:
  


Current Time: Sat Apr 19 02:57:07 EDT 2014

Powered by FUDForum. Page generated in 0.01593 seconds