package cn.edu.whu.boot.xml.xmlreader.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
 * @author Li Bozhao
 */
public class Meta implements Serializable {
    private static final long serialVersionUID = -7066838880974639139L;
//    private List<String> drawTool;
    private Map<String, List<String>> drawTool;
    private List<String> position;
    private List<Layer> baseMap;
    private List<Layer> operationLayers;

//    public List<String> getDrawTool() {
//        return drawTool;
//    }
//
//    public void setDrawTool(List<String> drawTool) {
//        this.drawTool = drawTool;
//    }
    public Map<String, List<String>> getDrawTool() {
        return drawTool;
    }
    public List<String> getDrawTool(String key) {
        List<String> res = new ArrayList<>(Objects.requireNonNull(drawTool.get("default")));
        if(key!=null && drawTool.containsKey(key)){
            res.addAll(Objects.requireNonNull(drawTool.get(key)));
        }
        return res;
    }

    public void setDrawTool(Map<String, List<String>> drawTool) {
        this.drawTool = drawTool;
    }

    public List<String> getPosition() {
        return position;
    }

    public void setPosition(List<String> position) {
        this.position = position;
    }

    public List<Layer> getBaseMap() {
        return baseMap;
    }

    public void setBaseMap(List<Layer> baseMap) {
        this.baseMap = baseMap;
    }

    public List<Layer> getOperationLayers() {
        return operationLayers;
    }

    public void setOperationLayers(List<Layer> operationLayers) {
        this.operationLayers = operationLayers;
    }
}
