I need to access the value of captions using enum as specified in below.
public enum Caption {
//Object types
//-------------
Obj1 ("Obj1"),
Obj2 ("Obj2"),
Obj3 ("Obj3"),
Obj4 ("Obj4"),
//Menu Bar
//-------------
Menu1 ("Menu1"),
Menu2 ("Menu2"),
Menu3 ("Menu3"),
Menu4 ("Menu4");
public String Value;
Caption(String caption) {
this.Value = caption;
}
} //Caption
I am able to access this as Caption.Obj1.Value. Instead I would like to access as Caption.ObjectTypes.Obj1.Value, Caption.MenuBar.Menu1.Value.
Could you please suggest how to use java here to achieve this.