java - Use enum like a getter? -
i have util class keeps track of important system variables: public static final string request_address = "http.request.address"; public static final string request_port = "http.request.port"; public static final string get(string property) { return system.getproperty(property); } and can retrieve these values so: string port = systempropertyhelper.get(systempropertyhelper.request_port); is possible, in java, these enum? request_port { return system.getproperty("http.request.port"); } string port = systempropertyhelper.request_port; i'd solve way. public static final string request_port = system.getproperty("http.request.port");