package org.bench4q.share.models.master;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

import org.bench4q.share.models.master.statistics.SampleModel;
import org.bench4q.share.models.monitor.ProcessorModel;

/**
 * when asked for processor, this will be response
 * 
 * @author coderfengyun
 * 
 */
@XmlRootElement
public class MonitorProcessorResponseModel implements MonitorResultBase {
	private List<ProcessorModel> processorModels;

	@XmlElementWrapper
	@XmlElement(name = "processorModel")
	public List<ProcessorModel> getProcessorModels() {
		return processorModels;
	}

	public void setProcessorModels(List<ProcessorModel> processorModels) {
		this.processorModels = processorModels;
	}

	public MonitorProcessorResponseModel() {
		this.setProcessorModels(new ArrayList<ProcessorModel>());
	}

	public void add(SampleModel model) {
		if (model instanceof ProcessorModel) {
			this.getProcessorModels().add((ProcessorModel) model);
		}
	}
}
