Java Map to String toString(Map params)

Here you can find the source of toString(Map params)

Description

to String

License

Open Source License

Declaration

public static String toString(Map<String, String> params) 

Method Source Code

//package com.java2s;
/*  /*from  www  .  j a va 2s .c o m*/
 *  ReActions, Minecraft bukkit plugin
 *  (c)2012-2014, fromgate, fromgate@gmail.com
 *  http://dev.bukkit.org/server-mods/reactions/
 *    
 *  This file is part of ReActions.
 *  
 *  ReActions 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.
 *
 *  ReActions 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 ReActions.  If not, see <http://www.gnorg/licenses/>.
 * 
 */

import java.util.Map;

public class Main {
    public static String toString(Map<String, String> params) {
        String str = "";
        for (String key : params.keySet())
            str += key + "[" + params.get(key) + "] ";
        return str.isEmpty() ? "empty" : str;
    }
}

Related

  1. toString(Map map)
  2. toString(Map attrs)
  3. toString(Map attrs)
  4. toString(Map m)
  5. toString(Map map)
  6. toString(Map map)
  7. toString(Map map, StringBuilder sb)
  8. toStringMap( Map enumMap)
  9. toStringMap(Map map)