All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.scribe.utils.MapUtils Maven / Gradle / Ivy

There is a newer version: 2024.11.18751.20241128T090041Z-241100
Show newest version
package org.scribe.utils;

import java.util.Map;

/**
 * @author: Pablo Fernandez
 */
public class MapUtils
{
  private MapUtils(){}

  public static  String toString(Map map)
  {
    if (map == null) return "";
    if (map.isEmpty()) return "{}";

    StringBuilder result = new StringBuilder();
    for(Map.Entry entry : map.entrySet())
    {
      result.append(String.format(", %s -> %s ", entry.getKey().toString(), entry.getValue().toString()));
    }
    return "{" + result.substring(1) + "}";
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy