Chinese mapping number routing I want to design Chinese mapping number routing. How can I improve this code in the method mapRouting?

I want to use reflect auto get method name by providing a value without if else, but I have no idea how to do it.

public class FwMappingChi {

    public static Map&lt;String, String&gt; mapRouting(String mapName){
        if(mapName == "ACTION") {
            return ACTION;
        }
        else if(mapName == "ENVIRONMENT") {
            return ENVIRONMENT;
        }
        else if(mapName == "RULE_TYPE") {
            return RULE_TYPE;
        }
        return null;
    }

    @SuppressWarnings("serial")
    private static final Map&lt;String, String&gt; ACTION = new HashMap&lt;String, String&gt;(){
        {
            put("0", "新增");
            put("1", "刪除");
        }
    };

    @SuppressWarnings("serial")
    private static final Map&lt;String, String&gt; ENVIRONMENT = new HashMap&lt;String, String&gt;(){
        {
            put("0", "正式環境");
            put("1", "長期UAT");
            put("2", "測試需求");
        }
    };

    @SuppressWarnings("serial")
    private static final Map&lt;String, String&gt; RULE_TYPE = new HashMap&lt;String, String&gt;(){
        {
            put("0", "系統間連接");
            put("1", "系統間連接");
            put("2", "人員維護用");
            put("3", "提供服務用");
            put("4", "User對外連接");
        }
    };
}


example:

List&lt;Map&lt;String, Object&gt;&gt; exportDatas = fwApplyListDetailMapper.getExportQuery(idsArr);
List&lt;List&lt;String&gt;&gt; pdfValues = new ArrayList&lt;&gt;();
for (int i = 0; i &lt; exportDatas.size(); i++) {
    List&lt;String&gt; record = new ArrayList&lt;&gt;();
    Map&lt;String, Object&gt; map = exportDatas.get(i);
    for (String index : headerIndex) {
        Object value = map.get(index);

        if(FwMappingChi.mapRouting(index) != null) {
            record.add(FwMappingChi.mapRouting(index).get(String.valueOf(value)));
        }

    }
    pdfValues.add(record);
    record = null;
}
You could simply put your maps in a map, as the mapRouting function is nothing but a simple lookup.

Prepare somewhere

private static final Map&lt;String, Map&lt;String, String&gt;&gt; MASTER = new HashMap&lt;&gt;() {
   {
       put("ACTION", ACTION);
       put("ENVIRONMENT", ENVIRONMENT);
       put("RULE_TYPE", RULE_TYPE);
   }
};


And simply access that map:

public static Map&lt;String, String&gt; mapRouting(String mapName) {
    return MASTER.get(mapName);
}


BTW: in times of Java 10 you should really use Map.of instead of anonymous map subclasses.