[测评系统]--测评系统核心代码库
linzhijie
2021-03-11 84fea994d2db7dc313ad1774f34eb12a45f8d6e7
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.ots.project.tool.report.SAQ.condition;
import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
 
@Getter
@Setter
public class SAQConditionVO {
    
    private String name;
    
    private String title;
    
    private String conditionKey;
    
    private List<String> conditionTarget;
    
    public SAQConditionVO(String name, String conditionKey, String conditionTargetPrefix) {
        this.name = name;
        init(conditionKey, conditionTargetPrefix);
    }
    
    public SAQConditionVO(String name, String title, String conditionKey, String conditionTargetPrefix) {
        this.name = name;
        this.title = title;
        init(conditionKey, conditionTargetPrefix);
    }
    public static void main(String[] args) {
        SAQConditionVO maqConditionVO = new SAQConditionVO("Flexibility_1", "P_Flex01", "LIBMAQ10");
        System.out.println(JSON.toJSON(maqConditionVO));
    }
    private void init(String conditionKey, String conditionTargetPrefix) {
        setConditionKey(conditionKey);
        
        List<String> collect = Arrays.asList("1", "2", "3", "4", "5", "6").stream().map(item -> {
            String target = conditionTargetPrefix + item;
            return target;
        }).collect(Collectors.toList());
        
        List<String> result = collect.stream().map(p -> {
            return p + "1," + p + "2";
        }).collect(Collectors.toList());
        setConditionTarget(result);
    }
    
    public void setConditionTarget(List targets) {
        this.conditionTarget = Collections.unmodifiableList(targets);
    }
}