Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get Collection by value?

 
Shiva.Om Kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


How can I avoid changing data in y or how can I create new List (object) to assign at //2. ?

Thanks.....
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change the reference. But why would you want something like this. I'm sure that this could be refactored to something that's much nicer.
 
Shiva.Om Kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for reply...

actually, x is my original object & y is similar object, I am carrying choices of user request and as per user choice updating data in y, but at any level user can undo all/any of his choices & in that case I need original data. Then further user can update his choice & undo the choice, until submit the final request.
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then look at the command pattern
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic