How to create enum dynamically?

后端 未结 4 548
感情败类
感情败类 2021-01-17 09:47

I need to create an enum based on a table from the database.

DB table MyColors: id/title/value 1/Red/1 2/Green/4

dynamic create

enum          


        
4条回答
  •  迷失自我
    2021-01-17 10:07

    Actually there is a possibility of dynamically creating enums using reflection: http://niceideas.ch/roller2/badtrash/entry/java_create_enum_instances_dynamically

提交回复
热议问题