All Downloads are FREE. Search and download functionalities are using the official Maven repository.

se.l4.vibe.trigger.TriggerEvent Maven / Gradle / Ivy

There is a newer version: 0.4.0
Show newest version
package se.l4.vibe.trigger;

/**
 * Indicates an event that has been automatically triggered.
 * 
 * @author Andreas Holstenson
 *
 */
public class TriggerEvent
{
	private final String description;
	private final boolean conditionMet;

	public TriggerEvent(String description, boolean conditionMet)
	{
		this.description = description;
		this.conditionMet = conditionMet;
	}
	
	/**
	 * Get a textual description of this event.
	 * 
	 * @return
	 */
	public String getDescription()
	{
		return description;
	}
	
	/**
	 * Get if the trigger condition is met or if this is "back to normal"
	 * event.
	 * 
	 * @return
	 */
	public boolean isConditionMet()
	{
		return conditionMet;
	}
	
	@Override
	public String toString()
	{
		if(! conditionMet)
		{
			return "Back to normal: " + description;
		}
		
		return description;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy