Here you can find the source of replaceKeyCharacter(Map
public static Map<String, Object> replaceKeyCharacter(Map<String, Object> map, char oldChar, char newChar)
//package com.java2s; /**/* w w w .jav a 2 s .co m*/ * This file is part of Graylog Beats Plugin. * * Graylog Beats Plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Graylog Beats Plugin is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Graylog Beats Plugin. If not, see <http://www.gnu.org/licenses/>. */ import java.util.HashMap; import java.util.Map; public class Main { public static Map<String, Object> replaceKeyCharacter(Map<String, Object> map, char oldChar, char newChar) { final Map<String, Object> result = new HashMap<>(map.size()); for (Map.Entry<String, Object> entry : map.entrySet()) { final String key = entry.getKey().replace(oldChar, newChar); final Object value = entry.getValue(); result.put(key, value); } return result; } }