(Map<String,String> map, Boolean onlyValue, String connector)
| 52 | |
| 53 | |
| 54 | public static String combineMapEntry(Map<String,String> map, Boolean onlyValue, String connector){ |
| 55 | String result = ""; |
| 56 | if (onlyValue) { |
| 57 | for (Map.Entry<String, String> entry : map.entrySet()){ |
| 58 | if (!result.equals("")){ |
| 59 | result += connector; |
| 60 | } |
| 61 | result += entry.getValue(); |
| 62 | } |
| 63 | }else { |
| 64 | for (Map.Entry<String, String> entry : map.entrySet()){ |
| 65 | if (!result.equals("")){ |
| 66 | result += connector; |
| 67 | } |
| 68 | result += entry; |
| 69 | } |
| 70 | } |
| 71 | return result; |
| 72 | } |
| 73 | public static void main (String[] args) { |
| 74 | Map<String, String> map = new TreeMap<String, String>(); |
| 75 | map.put("AKFC", "4kfc"); |
no test coverage detected