I saw the video(https://www.youtube.com/watch?v=Hzs6OBcvNQE) posted from google about price of enum and I'm convinced that enum cost more and has performance issue.
However, what about when I need to contain multiple information in an enum? Do I have to create intdef and stringdef to map the message?
Ie.
public enum Error{
NETWORK(1, "Network error!"),
STACK_OVER_FLOW(2, "Stack over flow error!");
final int mValue;
final String mMessage;
Error(int value, String message){
mValue = value;
mMessage = message;
}
public void getMessage(){
return mMessage;
}
public void getValue(){
return mValue
}
}