Here you can find the source of getString(Map
Parameter | Description |
---|---|
obj | a parameter |
public static <T> String getString(Map<T, Object> map, T key)
//package com.java2s; import java.util.Map; public class Main { /**// w w w. j a v a2 s . co m * get String from map, does not return a null * @param obj * @return */ public static <T> String getString(Map<T, Object> map, T key) { if (key != null) { Object obj = map.get(key); return String.valueOf(obj);//if obj is null, then ruturn "null" } else { return ""; } } }