Ecco uno splendido esempio del mio collega che ha reso gli enum facili da convertire in stringhe.
Davvero complimenti!!!
/** * * @author Jeff Fry */ public enum TaskNodeLogic { AND("And"), OR("Or"), XOR("Xor"), FIXED_SEQUENCE("Fixed sequence"), PARALLEL("Parallel"), UNORDERED_SEQUENCE("Unordered choice"), CONDITIONED_CHOICE("Conditioned choice"); public String name; // Constructor TaskNodeLogic(String name) { this.name = name; } @Override public String toString() { return this.name; } }
Nessun commento