Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » Equals and HashCode in ModelElements
Equals and HashCode in ModelElements [message #839921] Mon, 09 April 2012 12:18 Go to next message
Nepomuk Seiler is currently offline Nepomuk SeilerFriend
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 16:20 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
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 16:20 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
No Message Body
Previous Topic:overriding @Required in subclass
Next Topic:Sapphire.Edit
Goto Forum:
  


Current Time: Thu Apr 25 10:31:36 GMT 2024

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

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

Back to the top