Package org.eclipse.net4j.util.event

# Class EventUtil

java.lang.Object
org.eclipse.net4j.util.event.EventUtil

public final class EventUtil extends Object
Various static helper methods for dealing with `events`, `notifiers` and `listeners`.

Author:
  Eike Stepper

## Field Summary

Fields
Modifier and Type
Field
Description
`static final IListener[]`
`NO_LISTENERS`
`static final String`
`PRODUCT_GROUP_LISTENERS`

## Method Summary

Modifier and Type
Method
Description
`static <E extends IEvent>
AutoCloseable`
`addListener(Object notifier, Class<E> eventType, Consumer<E> eventConsumer)`
`static boolean`
`addListener(Object notifier, IListener listener)`
`static boolean`
`addUniqueListener(Object notifier, IListener listener)`
`static boolean`
`fireEvent(Object notifier, IEvent event)`
`static IListener[]`
`getListeners(Object notifier)`
`static IListener[]`
`getListeners(Object notifier, Predicate<IListener> predicate)`
`static boolean`
`hasListener(Object notifier, IListener listener)`
`static boolean`
`removeListener(Object notifier, IListener listener)`
`static IListener[]`
`removeListeners(Object notifier, Predicate<IListener> predicate)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### PRODUCT_GROUP_LISTENERS

public static final String PRODUCT_GROUP_LISTENERS

Since:
  3.29
See Also:
  - Constant Field Values

### NO_LISTENERS

public static final IListener[] NO_LISTENERS

Since:
  3.0

## Method Details

### addUniqueListener

public static boolean addUniqueListener(Object notifier, IListener listener)

Since:
  3.2

### addListener

public static boolean addListener(Object notifier, IListener listener)

### addListener

public static <E extends IEvent> AutoCloseable addListener(Object notifier, Class<E> eventType, Consumer<E> eventConsumer)

Since:
  3.15

### removeListener

public static boolean removeListener(Object notifier, IListener listener)

### removeListeners

public static IListener[] removeListeners(Object notifier, Predicate<IListener> predicate)

Since:
  3.20

### getListeners

public static IListener[] getListeners(Object notifier)

### getListeners

public static IListener[] getListeners(Object notifier, Predicate<IListener> predicate)

Since:
  3.20

### hasListener

public static boolean hasListener(Object notifier, IListener listener)

Since:
  3.2

### fireEvent

public static boolean fireEvent(Object notifier, IEvent event)

Since:
  3.29