Hi,
I was looking at Feedback Message and the levels defined as integers, in
move to Wicket 1.4, can we have an enumeration (or a class) like
FeedbackMessageLevel, here's the example :
public enum FeedbackMessageLevel{
// Debug level
DEBUG(100),
// Error level
ERROR (400),
// fatal level
FATAL(500);
... // and so on.
}
Inside this enum we can have a method that compares levels. (something like
comparator).Should we want this to be more flexible, (because enumeration
limits us from using just finite states), we can go for a Level class may
be.
*What will this buy me?*
Type safety, you can do a lot of things using enumeration (comparison is one
example), if we have a level class it is very very flexible (similar in
concept to logging frameworks). Plus its not such a good idea to have small
ints as a message level.
I don't know just some inputs, Any thoughts??
Regards
Vyas, Anirudh
|| ॐ ||