package cz.muni.fi.lasaris.sbms.api.entities;

import org.apache.commons.lang3.StringEscapeUtils;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class Scope {
	private String bimId;
	private String type;
	//private String deviceType;
	private String location;
	
	public Scope() {
	}

	public Scope(String bimId, String type, String deviceLocationBimId) {
		this.bimId = bimId;
		this.type = type;
		//this.deviceType = deviceType;
		this.location = deviceLocationBimId;
	}

	public Scope(String bimId, String type) {
		this.bimId = bimId;
		this.type = type;
	}

	public String getBimId() {
		return bimId;
	}

	public void setBimId(String bimId) {
		this.bimId = bimId;
	}
	
	public static String getResourceId(String bimId) {
		return StringEscapeUtils.escapeXml10(bimId);
	}
	
	@JsonIgnore
	public String getResourceId() {
		return Scope.getResourceId(this.bimId);
	}
	
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	/*
	public String getDeviceType() {
		return deviceType;
	}

	public void setDeviceType(String deviceType) {
		this.deviceType = deviceType;
	}
	*/
	public String getLocation() {
		return location;
	}

	public void setLocation(String deviceLocationBimId) {
		this.location = deviceLocationBimId;
	}

	@Override
	public String toString() {
		return "Scope [bimId=" + bimId + ", type=" + type + ", deviceLocationBimId=" + location + "]";
	}
	
	
}
