package org.wontovlab.model;

import java.util.List;

import org.wontovlab.model.TO.MaterialTO;
import org.wontovlab.model.TO.StepTO;


public class Step{
	private String id;
	private String description;
	private String applicationOntologyReference;
	private List<Material> materials;

	
	
	public Step(String id) {
		setId(id);
	}
	
	public Step() {
		
	}
	
	public Step(StepTO stepTO) {
		this.id = stepTO.getId();
		this.description = stepTO.getDescription();
		this.applicationOntologyReference = stepTO.getApplicationOntologyReference();
		
		for (MaterialTO material: stepTO.getMaterials()) {
			this.materials.add(new Material(material)); 
		}
	}
	
	public Step(Task task) {
		this.description = task.getDescription();
		this.applicationOntologyReference = task.getApplicationOntologyReference();
		this.materials = task.getMaterials();
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	public List<Material> getMaterials() {
		return materials;
	}
	public void setMaterials(List<Material> materials) {
		this.materials = materials;
	}

	
	public String getApplicationOntologyReference() {
		return applicationOntologyReference;
	}

	public void setApplicationOntologyReference(String applicationOntologyReference) {
		this.applicationOntologyReference = applicationOntologyReference;
	}
	
	
	
/*	@Override
	public boolean equals(Object obj) {
		if (((Step) obj).getId() == null) 
			return false;
		
		String id = ((Step) obj).getId();
		if (this.id.equals(id))
			return true;
		
		return false;
	
	}*/
	
/*	public boolean equals(String id) {
		if (this.id.equals(id))
			return true;
		
		return false;
	}*/
	
}
