package de.hottis.MeasurementCollector;

import java.time.LocalDateTime;
import java.util.Map;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public abstract class ADataObject {
	final protected Logger logger = LogManager.getRootLogger();

	private LocalDateTime timestamp;
	private String name;
	private Map<String, Object> values;
	
	public ADataObject(LocalDateTime timestamp, String name) {
		this.timestamp = timestamp;
		this.name = name;
	}

	public void setValues(Map<String, Object> values) {
		this.values = values;
	}
	
	abstract public String getTableName();
	
	public LocalDateTime getTimestamp() {
		return timestamp;
	}
	
	public Map<String, Object> getValues() {
		return values;
	}
	
	public String getName() {
		return name;
	}
	
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("<");
		sb.append(name);
		sb.append(", ");
		sb.append(timestamp);
		sb.append(", ");
		sb.append(values.toString());
		sb.append(">");
        return sb.toString();
	}
}
