Declare java enum with a String array

Posted by chama on Stack Overflow See other posts from Stack Overflow or by chama
Published on 2010-06-07T16:00:02Z Indexed on 2010/06/07 16:02 UTC
Read the original article Hit count: 189

Filed under:
|
|

I'm trying to declare an enum type based on data that I'm retrieving from a database. I have a method that returns a string array of all the rows in the table that I want to make into an enumerated type. Is there any way to construct an enum with an array?

This is what I tried, but from the way it looked in eclipse, it seemed like this just created a method by that name:

public enum ConditionCodes{
    Condition.getDescriptions();
}

Thank you in advance!

© Stack Overflow or respective owner

Related posts about java

Related posts about arrays