com.jgcomptech.tools.events.Event Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-ultimate-tools Show documentation
Show all versions of java-ultimate-tools Show documentation
A large repository of scripts for use in any Java program.
package com.jgcomptech.tools.events;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* Base class for custom events. Each event has associated an event source,
* event target and an event type.
* @since 1.4.0
*/
public class Event implements Cloneable, Serializable {
private static final long serialVersionUID = 20121107L;
/** Common supertype for all event types. */
public static final EventType ANY = EventType.ROOT;
/** The object on which the Event initially occurred. */
private transient Object source;
/** Type of the event. */
private EventType extends Event> eventType;
/** Event target that defines the path through which the event will travel when posted. */
private transient EventTarget extends Event> target;
/** Whether this event has been consumed by any filter or handler. */
private boolean consumed;
/** Event arguments to make available to the EventHandler. */
private final List