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"); 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -