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.NetworkInterfaceModel;

/**
 * When asked for network, this will be response
 * 
 * @author coderfengyun
 * 
 */
@XmlRootElement
public class MonitorNetworkReponseModel implements MonitorResultBase {
	private List<NetworkInterfaceModel> models;

	@XmlElementWrapper
	@XmlElement(name = "networkInterface")
	public List<NetworkInterfaceModel> getModels() {
		return models;
	}

	public void setModels(List<NetworkInterfaceModel> models) {
		this.models = models;
	}

	public MonitorNetworkReponseModel() {
		this.setModels(new ArrayList<NetworkInterfaceModel>());
	}

	public void add(SampleModel model) {
		if (model instanceof NetworkInterfaceModel) {
			this.getModels().add((NetworkInterfaceModel) model);
		}
	}
}
