You could store that const value in the enum like so. But why even use the const? Are you persisting the enum's?
public class SO3990319 {
public static enum PAGE {
SIGN_CREATE(1);
private final int constValue;
private PAGE(int constValue) {
this.constValue = constValue;
}
public int constValue() {
return constValue;
}
}
public static void main(String[] args) {
System.out.println("Name: " + PAGE.SIGN_CREATE.name());
System.out.println("Ordinal: " + PAGE.SIGN_CREATE.ordinal());
System.out.println("Const: " + PAGE.SIGN_CREATE.constValue());
System.out.println("Enum: " + PAGE.valueOf("SIGN_CREATE"));
}
}
Edit:
It depends on what you're using the int's for whether to use EnumMap or instance field.