-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestOther.java
More file actions
34 lines (29 loc) · 758 Bytes
/
TestOther.java
File metadata and controls
34 lines (29 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.edu.nbu;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
/**
* TODO
*
* @author fanwh
* @version V1.0
* @create 2017-07-21 14:48
*
*/
public class TestOther {
@Test
public void testStr(){
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("name","zhagnsan");
paramMap.put("age",12);
StringBuffer sb = new StringBuffer();
for (Map.Entry<String,Object> entry: paramMap.entrySet()) {
if(entry.getValue() != null){
sb.append(entry.getKey() + "=");
sb.append(entry.getValue());
sb.append("&");
}
}
System.out.println(sb.substring(0,sb.length()-1).toString());
}
}