package com.yeejoin.amos.fas.core.common.response;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import org.apache.commons.lang.StringUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

//import com.alibaba.druid.util.StringUtils;

public class RegionTreeResponse {
	
	private Long id;
	private String name;
	private String code;
	private Long parentId;
	private JSONArray ue4Location = new JSONArray();
	private JSONArray ue4Rotation = new JSONArray();
	private JSONArray ue4Extent = new JSONArray();
	private Boolean isBind;
	private String type;
	private Boolean isRegion;
	private JSONArray position3d = new JSONArray();;
	private String routePath;
	private String level;
	private String levelStr;
	private List<RegionTreeResponse> children = new ArrayList<>();

	public JSONArray getPosition3d() {
		return position3d;
	}

	public void setPosition3d(String position3d) {
		JSONArray jsonArray = new JSONArray();
		if(!StringUtils.isEmpty(position3d)){
			String[] arryStr = position3d.split(",");
			List<Double> collect = Arrays.stream(arryStr).map(Double::parseDouble).collect(Collectors.toList());
			jsonArray.addAll(collect);
		}
		this.position3d = jsonArray;
	}

	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public Long getParentId() {
		return parentId;
	}
	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}
	public JSONArray getUe4Location() {
		return ue4Location;
	}
	public void setUe4Location(String ue4Location) {
		this.ue4Location = StringUtils.isEmpty(ue4Location) ? new JSONArray() : JSONArray.parseArray(ue4Location);
	}
	public JSONArray getUe4Rotation() {
		return ue4Rotation;
	}
	public void setUe4Rotation(String ue4Rotation) {
		this.ue4Rotation = StringUtils.isEmpty(ue4Rotation) ? new JSONArray() : JSON.parseArray(ue4Rotation);
	}
	public JSONArray getUe4Extent() {
		return ue4Extent;
	}
	public void setUe4Extent(String ue4Extent) {
		this.ue4Extent = StringUtils.isEmpty(ue4Extent) ? new JSONArray() : JSON.parseArray(ue4Extent);
	}
	public Boolean getIsBind() {
		return isBind;
	}
	public void setIsBind(Boolean isBind) {
		this.isBind = isBind;
	}
	public List<RegionTreeResponse> getChildren() {
		return children;
	}
	public void setChildren(List<RegionTreeResponse> children) {
		this.children = children;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public Boolean getIsRegion() {
		return isRegion;
	}
	public void setIsRegion(Boolean isRegion) {
		this.isRegion = isRegion;
	}

	/**
	 * @return the routePath
	 */
	public String getRoutePath() {
		return routePath;
	}
	/**
	 * @param routePath the routePath to set
	 */
	public void setRoutePath(String routePath) {
		this.routePath = routePath;
	}
	/**
	 * @return the levelStr
	 */
	public String getLevelStr() {
		return levelStr;
	}
	/**
	 * @param levelStr the levelStr to set
	 */
	public void setLevelStr(String levelStr) {
		this.levelStr = levelStr;
	}
	/**
	 * @return the level
	 */
	public String getLevel() {
		return level;
	}
	/**
	 * @param level the level to set
	 */
	public void setLevel(String level) {
		this.level = level;
	}
	
	

}
