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

Enum values by 'string value'

 
Luc Lieber
Greenhorn
Posts: 14
C++ Notepad Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before I get flooded with "just use a map" replies, let me just say that I've always wondered if Java supports this type of operation

It's a bit hard for me to explain...but I want to produce these results:



//Loaded in the following array with my parser class



I hope this question isn't too cryptic...but I've been trying everything to no avail.

Thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that you can use the java.lang.Enum#valueOf method to do that.

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After reading your post once again, I may have misunderstood what you want to do. Do yo mean that "enum test" does not exist, and you want to dynamically create it ?
 
Luc Lieber
Greenhorn
Posts: 14
C++ Notepad Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After banging my head against a wall til now I've kind of lost interest to see if this is possible to do, sorry for wasting the time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic