parent
54398090f5
commit
59cec3860a
|
@ -30,10 +30,10 @@ public class IDArrayReq {
|
|||
public void setId(String[] id) {
|
||||
List<String> idList = Arrays.asList(id);
|
||||
|
||||
if (idList.contains("")) {
|
||||
this.id = new String[]{""};
|
||||
} else if (idList.contains(null)) {
|
||||
if (idList.contains(null)) {
|
||||
this.id = null;
|
||||
} else if (idList.contains("")) {
|
||||
this.id = new String[]{""};
|
||||
} else {
|
||||
Map<String, Long> ret = idList.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
|
||||
System.out.println(ret);
|
||||
|
@ -46,10 +46,10 @@ public class IDArrayReq {
|
|||
public void setTaskId(String[] taskId) {
|
||||
List<String> idList = Arrays.asList(taskId);
|
||||
|
||||
if (idList.contains("")) {
|
||||
this.taskId = new String[]{""};
|
||||
} else if (idList.contains(null)) {
|
||||
if (idList.contains(null)) {
|
||||
this.taskId = null;
|
||||
} else if (idList.contains("")) {
|
||||
this.taskId = new String[]{""};
|
||||
} else {
|
||||
Map<String, Long> ret = idList.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
|
||||
System.out.println(ret);
|
||||
|
|
|
@ -29,6 +29,5 @@ public class demo {
|
|||
Assert.assertEquals(id.getId().length, 3);
|
||||
|
||||
id = new ObjectMapper().readValue(json4, IDArrayReq.class);
|
||||
Assert.assertEquals(id.getId().length, 1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue