package de.fu_berlin.agdb.crepe.data;

import java.util.Date;
import java.util.Map;

/**
 * Interface for generic events (used for algebra).
 * @author Ralf Oechsner
 *
 */
public interface IEvent {

	/**
	 * Time stamp of event.
	 * @return time stamp of event.
	 */
	public Date getTimeStamp();
	
	/**
	 * Set time stamp of event.
	 * @param timeStamp time stamp of event
	 */
	public void setTimeStamp(Date timeStamp);
	
	/**
	 * Map that contains all attributes of an event. Every attribute has a name
	 * that is used as a key in the map.
	 * @return all attributes of the event
	 */
	public Map<String, IAttribute> getAttributes();
}

@@ -76,16 +76,43 @@
 til.Map;
+%0Aimport java.util.Optional;
 %0A%0A/**%0A *
@@ -657,11 +657,437 @@
 butes();
+%0A%0A%09/**%0A%09 * Returns the value of the given attribute, if available.%0A%09 * @param attribute Name of the attribute.%0A%09 * @return An optional containing the attribute value, if it was available.%0A%09 */%0A%09public default Optional%3CObject%3E getAttributeValue(String attribute) %7B%0A        return Optional.ofNullable(getAttributes())%0A                .map((attributes) -%3E attributes.get(attribute))%0A                .map(IAttribute::getValue);%0A%09%7D
 %0A%7D%0A

Add convenience method for attribute values to IEvent