Create a map of key to value, then just lookup the first value as the key and it will give you the value.
Alternatively you could create an enum, where the enum is the key and the toString of enum is your value.
I would prefer the map solution over the enum myself for this kind of situation.
Example of map
public abstract class LocationHelper {
public static Map<String, String> locations = new HashMap<String, String>();
static {
//either put individual elements into the map or
//read in from external file etc.
}
}
In another class you can then get the values by doing the following.
System.out.println(LocationHelper.locations.get("USNWYRK"));
This will print "USA, New York"
Note For anyone unfamiliar with the static { } block this is a static initializer, it is useful for populating static variables like maps. This is different to a insitance initializer { } which is a pre constructor initializer for each instance.