package risks;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.List;
/**
* Created by miguel on 24-06-2014.
*/
@XmlRootElement(name="resource")
@XmlAccessorType(XmlAccessType.FIELD)
public class Resource {
private String id;
private String name;
private String type;
private List<String> dependOn;
private String contextModelURI;
public Resource(String id, String name, String type, ArrayList<String> dependOn, String contextModelURI) {
this.id = id;
this.name = name;
this.type = type;
this.dependOn = dependOn;
this.contextModelURI = contextModelURI;
}
public Resource() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getContextModelURI() {
return contextModelURI;
}
public void setContextModelURI(String contextModelURI) {
this.contextModelURI = contextModelURI;
}
@Override
public boolean equals(Object obj) {
if (obj.getClass() == this.getClass()) {
Resource r = (Resource) obj;
if (!r.getId().equals(this.id))
return false;
if(!r.getContextModelURI().equals(contextModelURI))
return false;
if(!r.getName().equals(name))
return false;
if(!r.getType().equals(type))
return false;
} else
return false;
return true;
}
public List<String> getDependOn() {
return dependOn;
}
public void setDependOn(ArrayList<String> dependOn) {
this.dependOn = dependOn;
}
}