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

net.sf.javagimmicks.collections.event.cdi.CDICollectionEvent Maven / Gradle / Ivy

There is a newer version: 0.99-alpha1
Show newest version
package net.sf.javagimmicks.collections.event.cdi;

import java.util.Collection;

import net.sf.javagimmicks.collections.event.CollectionEvent;
import net.sf.javagimmicks.event.Observable;

/**
 * A CDI compatible wrapper around a {@link CollectionEvent}.
 * 

* CDI event objects may not have type parameters, so the type information needs * to be erased for the wrapped {@link CollectionEvent}. */ public class CDICollectionEvent implements CollectionEvent { private final CollectionEvent _origin; @SuppressWarnings("unchecked") CDICollectionEvent(final CollectionEvent origin) { _origin = (CollectionEvent) origin; } /** * Provides access to the wrapped {@link CollectionEvent} * * @return the wrapped {@link CollectionEvent} */ public CollectionEvent getWrappedEvent() { return _origin; } @Override public Type getType() { return _origin.getType(); } @Override public Collection getElements() { return _origin.getElements(); } @Override public Observable> getSource() { return _origin.getSource(); } }