package semantic.controler;

import semantic.model.IConvenienceInterface;
import semantic.model.IModelFunctions;
import semantic.model.ObservationEntity;

import java.util.List;

public class DoItYourselfControl implements IControlFunctions {
	private final IConvenienceInterface model;
	private final IModelFunctions customModel;

	public DoItYourselfControl(IConvenienceInterface model, IModelFunctions customModel) {
		this.model = model;
		this.customModel = customModel;
	}

	@Override
	public void instantiateObservations(List<ObservationEntity> obsList,
																			String paramURI) {
		obsList.forEach(observationEntity -> customModel.createObs(
				observationEntity.getValue().toString(),
				paramURI,
				customModel.createInstant(observationEntity.getTimestamp())));
	}
}
